view Logger.inc @ 75:5e76b6feb2ad

Correct check for matchlength.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Fri, 12 Oct 2012 01:19:23 +0200
parents 74f7b64bdb78
children
line wrap: on
line source

<?php
/**
 * Common access point for logging
 */
class Logger {
  /**
   * All logging goes through this function
   *
   * @param $level the severity level of this message
   * @param $msg message to be logged
   */
  static function msg($level, $msg)
  {
    if (DEBUG_LEVEL >= $level) {
      print $msg;
      if(ABORT_ON_LOG)
	exit;
    }
  }

  /**
   * Convenience function, logs a message with level VERBOSITY_WARNING
   *
   * @param $msg message to be logged
   */
  static function warn($msg)
  {
    self::msg(VERBOSITY_WARNING, $msg);
  }
}
?>