1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

Allow rolling-log to be set using the add() method. Use: e107::getLog()->add(); Upgraded the callMethod() function to allow for using existing objects as well as class name.

This commit is contained in:
Cameron
2014-10-22 13:26:03 -07:00
parent 280f100190
commit d248a5d2ff
3 changed files with 47 additions and 17 deletions

View File

@@ -136,7 +136,7 @@ class e_admin_log
/**
* Add a Save an event into the admin log.
* Add a Save an event into the admin, rolloing or user log.
*
* Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point.
* ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03')
@@ -150,11 +150,12 @@ class e_admin_log
*
* @param string $event_title
* @param mixed $event_details
* @param integer $event_type [optional] Log level
* @param unknown $event_code [optional]
* @param integer $event_type [optional] Log level eg. E_LOG_INFORMATIVE, E_LOG_NOTICE, E_LOG_WARNING, E_LOG_FATAL
* @param string $event_code [optional] - eg. 'BOUNCE'
* @param integer $target [optional] LOG_TO_ADMIN, LOG_TO_AUDIT, LOG_TO_ROLLING
* @return e_admin_log
*/
public function add($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE , $event_code = '')
public function add($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE , $event_code = '', $target = LOG_TO_ADMIN )
{
if ($event_code == '')
{
@@ -200,7 +201,7 @@ class e_admin_log
}
$this->e_log_event($event_type, -1, $event_code, $event_title, $event_detail, FALSE, LOG_TO_ADMIN);
$this->e_log_event($event_type, -1, $event_code, $event_title, $event_detail, FALSE, $target);
return $this;
}