Commit 1d853daf authored by Ian Jackson's avatar Ian Jackson

Dgit.pm: Introduce $printdebug_when_debuglevel

This is intended to be usefully localisable.

NFC.
Signed-off-by: Ian Jackson's avatarIan Jackson <ijackson@chiark.greenend.org.uk>
parent 9d98fd69
......@@ -66,6 +66,7 @@ BEGIN {
$ffq_refprefix $gdrlast_refprefix
initdebug enabledebug enabledebuglevel
printdebug debugcmd
$printdebug_when_debuglevel
$debugprefix *debuglevel *DEBUG
shellquote printcmd messagequote
$negate_harmful_gitattrs
......@@ -100,6 +101,7 @@ our $orig_f_tail_re = "$orig_f_comp_re\\.tar(?:\\.\\w+)?(?:$orig_f_sig_re)?";
our $git_null_obj = '0' x 40;
our $ffq_refprefix = 'ffq-prev';
our $gdrlast_refprefix = 'debrebase-last';
our $printdebug_when_debuglevel = 1;
# policy hook exit status bits
# see dgit-repos-server head comment for documentation
......@@ -156,7 +158,8 @@ sub enabledebuglevel ($) {
}
sub printdebug {
print DEBUG $debugprefix, @_ or die $! if $debuglevel>0;
print DEBUG $debugprefix, @_ or die $!
if $debuglevel >= $printdebug_when_debuglevel;
}
sub messagequote ($) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment