first commit
This commit is contained in:
34
modules/dpdpoland/classes/Log.php
Normal file
34
modules/dpdpoland/classes/Log.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
|
||||
require_once(_DPDPOLAND_CLASSES_DIR_.'Configuration.php');
|
||||
require_once(_DPDPOLAND_MODULE_DIR_.'dpdpoland.php');
|
||||
|
||||
class DpdPolandLog
|
||||
{
|
||||
const LOG_DEBUG = 'LOG_DEBUG';
|
||||
const LOG_ERROR = 'LOG_ERROR';
|
||||
|
||||
public static function addLog($message)
|
||||
{
|
||||
if(!in_array(Configuration::get(DpdPolandConfiguration::LOG_MODE), array(self::LOG_DEBUG)))
|
||||
return;
|
||||
|
||||
$logger = new FileLogger(0);
|
||||
$logger->setFilename(_DPDPOLAND_MODULE_DIR_."/log/logs.log");
|
||||
$logger->logDebug($message);
|
||||
}
|
||||
|
||||
public static function addError($message)
|
||||
{
|
||||
if(!in_array(Configuration::get(DpdPolandConfiguration::LOG_MODE), array(self::LOG_DEBUG, self::LOG_ERROR)))
|
||||
return;
|
||||
|
||||
$logger = new FileLogger(0);
|
||||
$logger->setFilename(_DPDPOLAND_MODULE_DIR_."/log/logs.log");
|
||||
$logger->logError($message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user