debug() public method

Logs a debug message.
public debug ( string $message ) : void
$message string Message to log.
return void
示例#1
0
<?php

require '../vendor/autoload.php';
use Logger\Logger;
use Logger\LogLevel;
$log = new Logger(include '../src/Logger/config.php');
$log->log(LogLevel::ALERT, 'Testing logs:' . (isset($_GET['msg']) ? $_GET['msg'] : ''));
$log->debug('Testing logs');
$log->warning('WARNING Message ');
$log->error('Error Message ');
示例#2
0
<?php

require '../vendor/autoload.php';
use Logger\Logger;
use Logger\LogLevel;
$logger = new Logger(include '../src/Logger/config.php');
$logger->log(LogLevel::ALERT, 'Testing logs:' . (isset($_GET['msg']) ? $_GET['msg'] : ''));
$logger->warning('WARNING Message ');
$logger->error('Error Message ');
$messageToLog = "User {username} has logged in";
$messageToLog = $logger->interpolate($messageToLog, ['username' => 'administrator']);
$logger->debug($messageToLog);