You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
526 B
PHTML

12 years ago
<?php
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
12 years ago
/**
11 years ago
* Write a log entry.
* This should be used to log user's activity.
*
* @param string $message
* @param string $level
12 years ago
*/
function engelsystem_log($message, $level = LogLevel::INFO)
8 years ago
{
$nick = "Guest";
/** @var LoggerInterface $logger */
$logger = app('logger');
$user = auth()->user();
if ($user) {
8 years ago
$nick = User_Nick_render($user);
}
$logger->log($level, '{nick}: {message}', ['nick' => $nick, 'message' => $message]);
12 years ago
}