Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 194 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Mustache_Logger_StreamLogger:: (9 methods):
  __construct()
  __destruct()
  setLevel()
  getLevel()
  log()
  writeLog()
  getLevelName()
  formatLine()
  interpolateMessage()


Class: Mustache_Logger_StreamLogger  - X-Ref

A Mustache Stream Logger.

The Stream Logger wraps a file resource instance (such as a stream) or a
stream URL. All log messages over the threshold level will be appended to
this stream.

Hint: Try `php://stderr` for your stream URL.
__construct($stream, $level = Mustache_Logger::ERROR)   X-Ref

param: resource|string $stream Resource instance or URL
param: int             $level  The minimum logging level at which this handler will be triggered

__destruct()   X-Ref
Close stream resources.


setLevel($level)   X-Ref
Set the minimum logging level.

param: int $level The minimum logging level which will be written

getLevel()   X-Ref
Get the current minimum logging level.

return: int

log($level, $message, array $context = array()   X-Ref
Logs with an arbitrary level.

param: mixed  $level
param: string $message
param: array  $context

writeLog($level, $message, array $context = array()   X-Ref
Write a record to the log.

param: int    $level   The logging level
param: string $message The log message
param: array  $context The log context

getLevelName($level)   X-Ref
Gets the name of the logging level.

param: int $level
return: string

formatLine($level, $message, array $context = array()   X-Ref
Format a log line for output.

param: int    $level   The logging level
param: string $message The log message
param: array  $context The log context
return: string

interpolateMessage($message, array $context = array()   X-Ref
Interpolate context values into the message placeholders.

param: string $message
param: array  $context
return: string