diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-09-15 08:53:55 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-09-15 08:53:55 +0000 |
commit | df46fbe8d506057b23c6d0fd322cfa251ae372ec (patch) | |
tree | 87e842a5a84780834b4d33f39a20d913a962f17f /src/htslib.c | |
parent | c11fe60beecd27709c31a0facecfaad5bbdb717b (diff) |
Fixed logging level (especially for robots.txt rules)
(manual backport of r867)
Diffstat (limited to 'src/htslib.c')
-rw-r--r-- | src/htslib.c | 27 |
1 files changed, 8 insertions, 19 deletions
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 |