summaryrefslogtreecommitdiff
path: root/src/htslib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/htslib.c')
-rw-r--r--src/htslib.c27
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