From df46fbe8d506057b23c6d0fd322cfa251ae372ec Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Sun, 15 Sep 2013 08:53:55 +0000 Subject: Fixed logging level (especially for robots.txt rules) (manual backport of r867) --- src/htslib.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/htslib.c') diff --git a/src/htslib.c b/src/htslib.c index d731d01..b52756a 100644 --- a/src/htslib.c +++ b/src/htslib.c @@ -5225,35 +5225,24 @@ HTSEXT_API void hts_log_print(httrackp * opt, int type, const char *format, ...) va_list args; const int save_errno = errno; const char *s_type = "unknown"; + const int level = type & 0xff; - switch (type & 0xff) { + // Check log level + if (opt->debug < level) { + return; + } + + switch (level) { case LOG_TRACE: - // check verbosity - if (opt->debug < 3) { - return; - } s_type = "trace"; break; case LOG_DEBUG: - // check verbosity - if (opt->debug < 2) { - return; - } s_type = "debug"; break; case LOG_INFO: - // check verbosity - if (opt->debug < 1) { - return; - } s_type = "info"; break; case LOG_NOTICE: - // check verbosity - if (opt->debug < 1) { - return; - } - /* nobreak; */ case LOG_WARNING: s_type = "warning"; break; @@ -5410,7 +5399,7 @@ HTSEXT_API httrackp *hts_create_opt(void) { opt->seeker = 1; // down opt->urlmode = 2; // relatif par défaut opt->no_type_change = 0; // change file types - opt->debug = 0; // pas de débug en plus + opt->debug = LOG_NOTICE; // small log opt->getmode = 3; // linear scan opt->maxsite = -1; // taille max site (aucune) opt->maxfile_nonhtml = -1; // taille max fichier non html -- cgit v1.2.3