diff -r 000000000000 -r 3b714bbb1347 delinquent_files/debug.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/delinquent_files/debug.inc Mon Jan 23 21:37:02 2023 +0100 @@ -0,0 +1,54 @@ +debuglevel = $l; + $this->warn( "Set debug level to $this->debuglevel" ); + } + + function msg ($s) { + $this->log( 0, $s ); + } + + function error ($s) { + $this->log( 1, $s ); + } + + function warn ($s) { + $this->log( 2, $s ); + } + + function info ($s) { + $this->log( 5, $s ); + } + + function debug ($s) { + $this->log( 8, $s ); + } + + function trace ($s) { + $this->log( 9, $s ); + } + + function log ($level,$msg) { + #$now = strftime("%Y-%m-%d %T"); + if( $level > $this->debuglevel ) { + return; + } + + $now = date('c'); + print( "$now [$level] $msg\n" ); + } +} +