You are here

protected function Logger::put2log in Module Object Oriented Programming API 6

Same name in this branch
  1. 6 component/decorator/moopapi.logger.inc \Logger::put2log()
  2. 6 component/decorator/logger/moopapi.logger.inc \Logger::put2log()
Same name and namespace in other branches
  1. 6.2 component/decorator/moopapi.logger.inc \Logger::put2log()
  2. 6.2 component/decorator/logger/moopapi.logger.inc \Logger::put2log()
  3. 7.2 component/decorator/logger/moopapi.logger.inc \Logger::put2log()
  4. 7 component/decorator/logger/moopapi.logger.inc \Logger::put2log()
2 calls to Logger::put2log()
Logger::log in component/decorator/moopapi.logger.inc
Logger::log in component/decorator/logger/moopapi.logger.inc

File

component/decorator/moopapi.logger.inc, line 82

Class

Logger
Logger.

Code

protected function put2log($message, $placeholders = array()) {
  $destination = NULL;
  $extra_headers = NULL;

  // Match corresponding log levels of error_log function.
  $message_type = 0;
  switch ($this->level) {
    case self::LOGGER_FILE:
      $message_type = 3;
      $destination = $this
        ->getDestination();
      break;
    case self::LOGGER_EMAIL:
      $message_type = 1;

      // @todo Real headers.
      $extra_headers = NULL;
    case self::LOGGER_DB:
    default:

      // Just use default logging behavior.
      break;
  }
  error_log(date($this->date_format, time()) . ' ' . t($message, $placeholders) . "\n", $message_type, $destination, $extra_headers);
}