本文整理汇总了PHP中X_Debug::init方法的典型用法代码示例。如果您正苦于以下问题:PHP X_Debug::init方法的具体用法?PHP X_Debug::init怎么用?PHP X_Debug::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X_Debug
的用法示例。
在下文中一共展示了X_Debug::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initDebug
/**
* Init debug system
* @deprecated
* @see X_Debug::init()
* @param string $path
*/
public static function initDebug($path)
{
X_Debug::init($path);
}
示例2: _initDebug
protected function _initDebug()
{
$this->bootstrap('configs');
$configs = $this->getResource('configs');
if ($configs instanceof Zend_Config) {
try {
if ($configs->general->debug->enabled) {
// init debug system:
// config default:
// /tmp/vlcShares.debug.log
// log none
$debugPath = sys_get_temp_dir() . '/vlcShares.debug.log';
if ($configs->general->debug->path != null && trim($configs->general->debug->path) != '') {
$debugPath = $configs->general->debug->get('path', sys_get_temp_dir()) . '/vlcShares.debug.log';
}
X_Debug::init($debugPath, (int) $configs->general->debug->level);
}
} catch (Exception $e) {
// no init
}
}
}
示例3: newThread
/**
* Create a new thread if $threadId is not already running
*
* @param string $threadId
* @return X_Threads_Thread_Info|X_Threads_Thread
*/
public function newThread($threadId)
{
$thread = $this->getMonitor()->getThread($threadId);
if ($thread->getState() == X_Threads_Thread_Info::STOPPED) {
// create a new thread and return it
$thread = new X_Threads_Thread($threadId, $this);
if (!$this->isLogger()) {
$thread->setLogger(new X_Threads_Logger_Null());
} else {
$thread->setLogger(new X_Threads_Logger_File("vlcShares.thread-{$threadId}.log", X_Debug::getLogPath()));
// redirect standard debug too if enabled
if (X_Debug::isEnabled()) {
X_Debug::i("Forking debug log to {" . X_Debug::getLogPath() . "/vlcShares.thread-{$threadId}.log");
X_Debug::init(X_Debug::getLogPath() . "/vlcShares.thread-{$threadId}.log", X_Debug::getLevel());
}
}
}
return $thread;
}
示例4: log
public function log($msg)
{
if ($this->logger == null) {
// initialize default logger
$this->setLogger(new X_Threads_Logger_File("vlcShares.thread-{$this->getId()}.log", sys_get_temp_dir()));
// redirect standard debug too if enabled
if (X_Debug::isEnabled()) {
X_Debug::init(sys_get_temp_dir() . "/vlcShares.thread-{$this->getId()}.log", X_Debug::getLevel());
}
}
$this->logger->log($msg);
}