本文整理汇总了PHP中Log::UPTO方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::UPTO方法的具体用法?PHP Log::UPTO怎么用?PHP Log::UPTO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::UPTO方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Log_firebug
/**
* Constructs a new Log_firebug object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_firebug($name = '', $ident = 'PHP', $conf = array(), $level = PEAR_LOG_DEBUG)
{
if (!class_exists('G')) {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.g.php';
}
$this->_id = G::encryptOld(microtime());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (isset($conf['buffering'])) {
$this->_buffering = $conf['buffering'];
}
if ($this->_buffering) {
register_shutdown_function(array(&$this, '_Log_firebug'));
}
if (!empty($conf['lineFormat'])) {
$this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']);
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
}
}
示例2: Log_console
/**
* Constructs a new Log_console object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_console($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (!empty($conf['stream'])) {
$this->_stream = $conf['stream'];
}
if (isset($conf['buffering'])) {
$this->_buffering = $conf['buffering'];
}
if (!empty($conf['lineFormat'])) {
$this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']);
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
}
/*
* If output buffering has been requested, we need to register a
* shutdown function that will dump the buffer upon termination.
*/
if ($this->_buffering) {
register_shutdown_function(array(&$this, '_Log_console'));
}
}
示例3: Log_file
/**
* Constructs a new Log_file object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param array $maxLevel Maximum priority level at which to log.
* @access public
*/
function Log_file($name, $ident = '', $conf = array(), $maxLevel = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_filename = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($maxLevel);
if (isset($conf['append'])) {
$this->_append = $conf['append'];
}
if (!empty($conf['mode'])) {
$this->_mode = $conf['mode'];
}
if (!empty($conf['lineFormat'])) {
$this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']);
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
}
if (!empty($conf['eol'])) {
$this->_eol = $conf['eol'];
} else {
$this->_eol = strstr(PHP_OS, 'WIN') ? "\r\n" : "\n";
}
register_shutdown_function(array(&$this, '_Log_file'));
}
示例4: Log_console
/**
* Constructs a new Log_console object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_console($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
if (!class_exists('G')) {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.g.php';
}
$this->_id = G::encryptOld(microtime());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (!empty($conf['stream'])) {
$this->_stream = $conf['stream'];
}
if (isset($conf['buffering'])) {
$this->_buffering = $conf['buffering'];
}
if (!empty($conf['lineFormat'])) {
$this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']);
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
}
/*
* If output buffering has been requested, we need to register a
* shutdown function that will dump the buffer upon termination.
*/
if ($this->_buffering) {
register_shutdown_function(array(&$this, '_Log_console'));
}
}
示例5: Log_display
/**
* Constructs a new Log_display object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_display($name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
if (!class_exists('G')) {
$realdocuroot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
$docuroot = explode('/', $realdocuroot);
array_pop($docuroot);
$pathhome = implode('/', $docuroot) . '/';
array_pop($docuroot);
$pathTrunk = implode('/', $docuroot) . '/';
require_once $pathTrunk . 'gulliver/system/class.g.php';
}
$this->_id = G::encryptOld(microtime());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (isset($conf['error_prepend'])) {
$this->_error_prepend = $conf['error_prepend'];
} else {
$this->_error_prepend = ini_get('error_prepend_string');
}
if (isset($conf['error_append'])) {
$this->_error_append = $conf['error_append'];
} else {
$this->_error_append = ini_get('error_append_string');
}
if (isset($conf['linebreak'])) {
$this->_linebreak = $conf['linebreak'];
}
}
示例6: __construct
/**
* Constructs a new Log_console object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
public function __construct($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (!empty($conf['stream'])) {
$this->_stream = $conf['stream'];
} elseif (defined('STDOUT')) {
$this->_stream = STDOUT;
} else {
$this->_stream = fopen('php://output', 'a');
$this->_closeResource = true;
}
if (isset($conf['buffering'])) {
$this->_buffering = $conf['buffering'];
}
if (!empty($conf['lineFormat'])) {
$this->_lineFormat = str_replace(array_keys($this->_formatMap), array_values($this->_formatMap), $conf['lineFormat']);
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
}
/*
* If output buffering has been requested, we need to register a
* shutdown function that will dump the buffer upon termination.
*/
if ($this->_buffering) {
register_shutdown_function(array(&$this, '_Log_console'));
}
}
示例7: Log_daemon
/**
* Constructs a new syslog object.
*
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $maxLevel Maximum level at which to log.
* @access public
*/
function Log_daemon($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
/* Ensure we have a valid integer value for $name. */
if (empty($name) || !is_int($name)) {
$name = LOG_SYSLOG;
}
$this->_id = md5(microtime());
$this->_name = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (isset($conf['ip'])) {
$this->_ip = $conf['ip'];
}
if (isset($conf['proto'])) {
$this->_proto = $conf['proto'];
}
if (isset($conf['port'])) {
$this->_port = $conf['port'];
}
if (isset($conf['maxsize'])) {
$this->_maxsize = $conf['maxsize'];
}
if (isset($conf['timeout'])) {
$this->_timeout = $conf['timeout'];
}
$this->_proto = $this->_proto . '://';
register_shutdown_function(array(&$this, '_Log_daemon'));
}
示例8: logif
public static function logif($level = PEAR_LOG_DEBUG)
{
static $mask = NULL;
if ($mask === NULL) {
$mask = Log::UPTO(WF_LOG_LEVEL);
}
return 1 << $level & $mask ? true : false;
}
示例9: WordPressOpenID
function WordPressOpenID()
{
$this->log =& Log::singleton('error_log', PEAR_LOG_TYPE_SYSTEM, 'OpenID');
//$this->log = &Log::singleton('file', ABSPATH . get_option('upload_path') . '/php.log', 'WPOpenID');
// Set the log level
$wpopenid_log_level = constant('PEAR_LOG_' . strtoupper(WPOPENID_LOG_LEVEL));
$this->log->setMask(Log::UPTO($wpopenid_log_level));
}
示例10: GetLogger
/**
* Get the shared instance for the logger
* @return \Log
*/
public static function GetLogger()
{
$log = new \Log("this message is ignored, however not supplying one throws an error :o/");
$logger = $log->singleton('file', Setup::Configuration()->CachingDirectory . "/log.log", ' ');
if (!self::Configuration()->EnableDebugLogging) {
$mask = \Log::UPTO(\PEAR_LOG_INFO);
$logger->setMask($mask);
}
return $logger;
}
示例11: Log_syslog
/**
* Constructs a new syslog object.
*
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_syslog($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
/* Ensure we have a valid integer value for $name. */
if (empty($name) || !is_int($name)) {
$name = LOG_SYSLOG;
}
$this->_id = md5(microtime());
$this->_name = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
}
示例12: Log_mcal
/**
* Constructs a new Log_mcal object.
*
* @param string $name The category to use for our events.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_mcal($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_name = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
$this->_calendar = $conf['calendar'];
$this->_username = $conf['username'];
$this->_password = $conf['password'];
$this->_options = $conf['options'];
}
示例13: setUp
public function setUp()
{
$this->log_file = "/tmp/log_file.test";
// delete $log_file...
if (file_exists($this->log_file)) {
unlink($this->log_file);
}
$this->logger = Log::factory('file', $this->log_file, 'AdvancedDVDLibrary');
$mask = Log::UPTO(PEAR_LOG_DEBUG);
$this->logger->setMask($mask);
}
示例14: Log_error_log
/**
* Constructs a new Log_error_log object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_error_log($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_type = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (!empty($conf['destination'])) {
$this->_destination = $conf['destination'];
}
if (!empty($conf['extra_headers'])) {
$this->_extra_headers = $conf['extra_headers'];
}
}
示例15: Log_win
/**
* Constructs a new Log_win object.
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_win($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_name = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (isset($conf['title'])) {
$this->_title = $conf['title'];
}
if (isset($conf['colors']) && is_array($conf['colors'])) {
$this->_colors = $conf['colors'];
}
register_shutdown_function(array(&$this, '_Log_win'));
}