view Logger.inc.php @ 136:60bc8f62384d default tip

Use internal URL if available to generate Sitemap.
author Tom Fredrik Blenning <bfg@bfgconsult.no>
date Mon, 23 Jan 2023 00:17:36 +0100
parents b6b4a58c7625
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);
  }
}
?>