diff options
Diffstat (limited to 'src/libnix/util.cc')
-rw-r--r-- | src/libnix/util.cc | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/libnix/util.cc b/src/libnix/util.cc index 016ee991a..299a37f6c 100644 --- a/src/libnix/util.cc +++ b/src/libnix/util.cc @@ -110,7 +110,7 @@ bool pathExists(const Path & path) void deletePath(const Path & path) { - msg(lvlVomit, format("deleting path `%1%'") % path); + printMsg(lvlVomit, format("deleting path `%1%'") % path); struct stat st; if (lstat(path.c_str(), &st)) @@ -194,15 +194,9 @@ Verbosity verbosity = lvlError; static int nestingLevel = 0; -Nest::Nest(Verbosity level, const format & f) +Nest::Nest() { - if (level > verbosity) - nest = false; - else { - msg(level, f); - nest = true; - nestingLevel++; - } + nest = false; } @@ -212,7 +206,17 @@ Nest::~Nest() } -void msg(Verbosity level, const format & f) +void Nest::open(Verbosity level, const format & f) +{ + if (level <= verbosity) { + printMsg_(level, f); + nest = true; + nestingLevel++; + } +} + + +void printMsg_(Verbosity level, const format & f) { if (level > verbosity) return; string spaces; @@ -222,12 +226,6 @@ void msg(Verbosity level, const format & f) } -void debug(const format & f) -{ - msg(lvlDebug, f); -} - - void readFull(int fd, unsigned char * buf, size_t count) { while (count) { |