Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

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

Defines 1 class

Google_Logger_Abstract:: (16 methods):
  __construct()
  setLevel()
  shouldHandle()
  emergency()
  alert()
  critical()
  error()
  warning()
  notice()
  info()
  debug()
  log()
  interpolate()
  reverseJsonInContext()
  export()
  normalizeLevel()


Class: Google_Logger_Abstract  - X-Ref

Abstract logging class based on the PSR-3 standard.

NOTE: We don't implement `Psr\Log\LoggerInterface` because we need to
maintain PHP 5.2 support.

__construct(Google_Client $client)   X-Ref

param: Google_Client $client  The current Google client

setLevel($level)   X-Ref
Sets the minimum logging level that this logger handles.

param: integer $level

shouldHandle($level)   X-Ref
Checks if the logger should handle messages at the provided level.

param: integer $level
return: boolean

emergency($message, array $context = array()   X-Ref
System is unusable.

param: string $message The log message
param: array $context  The log context

alert($message, array $context = array()   X-Ref
Action must be taken immediately.

Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.

param: string $message The log message
param: array $context  The log context

critical($message, array $context = array()   X-Ref
Critical conditions.

Example: Application component unavailable, unexpected exception.

param: string $message The log message
param: array $context  The log context

error($message, array $context = array()   X-Ref
Runtime errors that do not require immediate action but should typically
be logged and monitored.

param: string $message The log message
param: array $context  The log context

warning($message, array $context = array()   X-Ref
Exceptional occurrences that are not errors.

Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.

param: string $message The log message
param: array $context  The log context

notice($message, array $context = array()   X-Ref
Normal but significant events.

param: string $message The log message
param: array $context  The log context

info($message, array $context = array()   X-Ref
Interesting events.

Example: User logs in, SQL logs.

param: string $message The log message
param: array $context  The log context

debug($message, array $context = array()   X-Ref
Detailed debug information.

param: string $message The log message
param: array $context  The log context

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

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

interpolate(array $variables = array()   X-Ref
Interpolates log variables into the defined log format.

param: array $variables The log variables.
return: string

reverseJsonInContext(array &$context)   X-Ref
Reverses JSON encoded PHP arrays and objects so that they log better.

param: array $context The log context

export($value)   X-Ref
Exports a PHP value for logging to a string.

param: mixed $value The value to

normalizeLevel($level)   X-Ref
Converts a given log level to the integer form.

param: mixed $level   The logging level
return: integer $level The normalized level