NAME
Stow::Util - general utilities
SYNOPSIS
use Stow::Util qw(debug set_debug_level error ...);
DESCRIPTION
Supporting utility routines for Stow.
IMPORTABLE SUBROUTINES
error($format, @args)
Outputs an error message in a consistent form and then dies.
set_debug_level($level)
Sets verbosity level for debug()
.
set_test_mode($on_or_off)
Sets testmode on or off.
debug($level[, $indent_level], $msg)
Logs to STDERR based on $debug_level
setting. $level
is the minimum verbosity level required to output $msg
. All output is to STDERR to preserve backward compatibility, except for in test mode, when STDOUT is used instead. In test mode, the verbosity can be overridden via the TEST_VERBOSE
environment variable.
Verbosity rules:
- 0: errors only
- >= 1: print operations: LINK/UNLINK/MKDIR/RMDIR/MV
- >= 2: print operation exceptions
-
e.g. "_this_ already points to _that_", skipping, deferring, overriding, fixing invalid links
- >= 3: print trace detail: trace: stow/unstow/package/contents/node
- >= 4: debug helper routines
- >= 5: debug ignore lists