view Logger.inc @ 120:111770d32c2e

Workaround for pecl_http not working with PHP7
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Thu, 28 Dec 2017 18:40:56 +0100
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);
  }
}
?>