Commit fcf4043a authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added sprintf support in logging

If ->log is given additional arguments, the $msg will be used as a format, and all additional arguments will be used as parameters to sprintf()
parent 389c79cf
......@@ -648,7 +648,11 @@ sub log
$msg = "[CORE] $logtxt: $msg";
}
$self->SUPER::log($level,"[".$self->log_time." - $$] $msg",@args);
# If we have args, this is more than likely a format string & args
if (@args > 0) {
$msg = sprintf($msg,@args);
}
$self->SUPER::log($level,"[".$self->log_time." - $$] $msg");
}
......
Supports Markdown
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