1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117:
<?php
namespace VSP\Core\Interfaces;
defined( 'ABSPATH' ) || exit;
/**
* Interface VSP_Logger_Interface
*
* @author Varun Sridharan <varunsridharan23@gmail.com>
*/
interface Logger {
/**
* Add a log entry.
*
* @param string $level One of the following:
* 'emergency': System is unusable.
* 'alert': Action must be taken immediately.
* 'critical': Critical conditions.
* 'error': Error conditions.
* 'warning': Warning conditions.
* 'notice': Normal but significant condition.
* 'info': Informational messages.
* 'debug': Debug-level messages.
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function log( $level, $message, $context = array() );
/**
* Adds an emergency level message.
*
* System is unusable.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function emergency( $message, $context = array() );
/**
* Adds an alert level message.
*
* Action must be taken immediately.
* Example: Entire website down, database unavailable, etc.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function alert( $message, $context = array() );
/**
* Adds a critical level message.
*
* Critical conditions.
* Example: Application component unavailable, unexpected exception.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function critical( $message, $context = array() );
/**
* Adds an error level message.
*
* Runtime errors that do not require immediate action but should typically be logged
* and monitored.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function error( $message, $context = array() );
/**
* Adds a warning level message.
*
* 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 Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function warning( $message, $context = array() );
/**
* Adds a notice level message.
*
* Normal but significant events.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function notice( $message, $context = array() );
/**
* Adds a info level message.
*
* Interesting events.
* Example: User logs in, SQL logs.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function info( $message, $context = array() );
/**
* Adds a debug level message.
*
* Detailed debug information.
*
* @param string $message Log message.
* @param array $context Optional. Additional information for log handlers.
*/
public function debug( $message, $context = array() );
}