[med-svn] [htslib] 07/10: Replaced fprintf(stderr, ...) calls with hts_log_<level> calls.

Andreas Tille tille at debian.org
Wed Jul 19 19:54:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository htslib.

commit ab66ccdf9247212079538056dff034b083ce63dc
Author: Anders Kaplan <anders.kaplan at magasin1.se>
Date:   Mon Jul 3 23:07:02 2017 +0200

    Replaced fprintf(stderr, ...) calls with hts_log_<level> calls.
---
 cram/sam_header.c |  3 +--
 hts.c             | 11 ++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cram/sam_header.c b/cram/sam_header.c
index 3b3daa2..288a356 100644
--- a/cram/sam_header.c
+++ b/cram/sam_header.c
@@ -776,8 +776,7 @@ static enum sam_sort_order sam_hdr_parse_sort_order(SAM_hdr *hdr) {
 		else if (strcmp(tag->str+3, "coordinate") == 0)
 		    so = ORDER_COORD;
 		else if (strcmp(tag->str+3, "unknown") != 0)
-		    fprintf(stderr, "Unknown sort order field: %s\n",
-			    tag->str+3);
+		    hts_log_error("Unknown sort order field: %s", tag->str+3);
 	    }
 	}
     }
diff --git a/hts.c b/hts.c
index fe35d78..c6512d1 100644
--- a/hts.c
+++ b/hts.c
@@ -994,13 +994,14 @@ int hts_set_opt(htsFile *fp, enum hts_fmt_option opt, ...) {
 
         if (hf) {
             va_start(args, opt);
-            if (hfile_set_blksize(hf, va_arg(args, int)) != 0 && hts_verbose >= 2)
-                fprintf(stderr, "[W::%s] Failed to change block size\n", __func__);
+            if (hfile_set_blksize(hf, va_arg(args, int)) != 0)
+                hts_log_warning("Failed to change block size");
             va_end(args);
-        } else if (hts_verbose >= 2)
+        }
+        else {
             // To do - implement for vcf/bcf.
-            fprintf(stderr, "[W::%s] cannot change block size for this format\n", __func__);
-
+            hts_log_warning("Cannot change block size for this format");
+        }
 
         return 0;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/htslib.git



More information about the debian-med-commit mailing list