EQdkp Plus Navigation:   Home  |   Forum  |   Wiki  |   Translate  |   Bugtracker  |   WebSVN  |  USVN

Logging

From EQdkp Plus Wiki

Information
min. EQDKP-PLUS Version 0.7.0.0




We have now a global logging class that can log core and plugin-actions.

Logging

$log_action = array(
            'header'              => '{L_ACTION_NEWS_UPDATED}',
            '{L_ID}'              => $this->url_id,
            '{L_HEADLINE_BEFORE}' => $this->old_news['news_headline'],
            '{L_MESSAGE_BEFORE}'  => nl2br($this->old_news['news_message']),
            '{L_HEADLINE_AFTER}'  => $this->find_difference($this->old_news['news_headline'], $_POST['news_headline']),
            '{L_MESSAGE_AFTER}'   => nl2br($_POST['news_message']),
            '{L_UPDATED_BY}'      => $this->admin_user);
 
$logs->add( $log_action['header'], $log_action);

If you want to log an action for an Plugin, you can use a function to change the plugin:

$logs->ChangePlugin($pluginname);

Or:

$logs->add( $log_action['header'], $log_action, true, 'raidplan');

The third param is if the action has been done by an admin (true) or a user (false). The whole add-function looks like this:

function add($tag, $value, $admin_action = true, $plugin = '', $result='{L_SUCCESS}')

Get Logs

use PDH to receive Logs