engelsystem/includes/sys_log.php

21 lines
375 B
PHP
Raw Normal View History

2012-12-26 14:02:27 +01:00
<?php
/**
2013-10-13 00:52:44 +02:00
* Write a log entry.
* This should be used to log user's activity.
*
2017-01-03 03:22:48 +01:00
* @param string $message
2012-12-26 14:02:27 +01:00
*/
2017-01-02 03:57:23 +01:00
function engelsystem_log($message)
{
global $user;
$nick = "Guest";
$logger = app('logger');
2017-01-02 03:57:23 +01:00
if (isset($user)) {
$nick = User_Nick_render($user);
}
$logger->info('{nick}: {message}', ['nick' => $nick, 'message' => $message]);
2012-12-26 14:02:27 +01:00
}