diff options
Diffstat (limited to 'lib/generic.cc')
-rw-r--r-- | lib/generic.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/generic.cc b/lib/generic.cc index 1f6b61d..6e6afb9 100644 --- a/lib/generic.cc +++ b/lib/generic.cc @@ -28,7 +28,7 @@ char verbosity = 0; char * heads[] = {"EE", "--", "WW", "II"}; -void Base::printm(int level, String m, ...) { +void Base::printm(int level, const ugly_string & m, ...) { va_list ap; if (verbosity < level) { @@ -40,7 +40,23 @@ void Base::printm(int level, String m, ...) { } va_start(ap, m); - vfprintf(stderr, m.to_charp(), ap); + vfprintf(stderr, m.p, ap); + va_end(ap); +} + +void Base::printm(int level, const char * m, ...) { + va_list ap; + + if (verbosity < level) { + return; + } + + if (level >= 0) { + fprintf(stderr, "(%s) ", heads[level]); + } + + va_start(ap, m); + vfprintf(stderr, m, ap); va_end(ap); } |