From: Matteo Nastasi (mop) Date: Tue, 19 Dec 2006 11:48:12 +0000 (+0000) Subject: Log disattivabile X-Git-Tag: 3.0.0~418 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=df5eead2cf1da99652042a299afef80b86ccc4d7;p=brisk.git Log disattivabile --- diff --git a/web/brisk.phh b/web/brisk.phh index c3b810b..7985a10 100644 --- a/web/brisk.phh +++ b/web/brisk.phh @@ -31,6 +31,7 @@ define(STREAM_TIMEOUT, 20); define(EXPIRE_TIME, 180); define(GARBAGE_TIMEOUT, 30); define(NICKSERV, "SERVER"); +define(BRISK_DEBUG, FALSE); // define(DEBUGGING, "local"); function xcape($s) @@ -569,43 +570,63 @@ function make_seed() } function log_main($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_main.log", 'a'); fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); fclose($fp); } function log_rd($sess, $log) { - // $fp = fopen("/tmp/brisk_rd.log", 'a'); - // fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); - // fclose($fp); - ; + if (BRISK_DEBUG != TRUE) + return; + + $fp = fopen("/tmp/brisk_rd.log", 'a'); + fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); + fclose($fp); } function log_rd2($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_rd2.log", 'a'); fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); fclose($fp); } function log_send($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_send.log", 'a'); fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); fclose($fp); } function log_auth($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_auth.log", 'a'); fwrite($fp, sprintf("SESS: [%d] [%s] [%s]\n", time(), $sess, $log)); fclose($fp); } function log_wr($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_wr.log", 'a'); fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); fclose($fp); } function log_load($sess, $log) { + if (BRISK_DEBUG != TRUE) + return; + $fp = fopen("/tmp/brisk_load.log", 'a'); fwrite($fp, sprintf("SESS: [%s] [%s]\n", $sess, $log)); fclose($fp);