本文整理汇总了PHP中Logger::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::instance方法的具体用法?PHP Logger::instance怎么用?PHP Logger::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance($name, $level = 1)
{
if (is_null(self::$instance)) {
self::$instance = new Logger($name, $level);
}
return self::$instance;
}
示例2: logger
/**
* Returns a logger identified by the given name.
*
* If the logger does not exist it is created.
*
* @param string $name Name of the logger
*
* @return object Logger
*/
function logger($name = null)
{
if (null === $name) {
return Logger::instance();
}
return Logger::instance()->get_logger($name);
}
示例3: getInstance
/**
* returns the instance created by its first invoke.
*
* @return Logger
*/
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
示例4: getInstance
/**
* Method getInstance
* @access static
* @return mixed
* @since 1.1.12
*/
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
示例5: getInstance
/**
*
* Return logger instance or create new instance
*
* @return object (PDO)
*
* @access public
*
*/
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new Logger();
}
return self::$instance;
}
示例6: getInstance
public static function getInstance($filepath = 0, $priority = 0)
{
if (!isset(self::$instance)) {
self::$instance = new Logger($filepath, $priority);
}
return self::$instance;
}
示例7: self
public static function &getInstance()
{
if (self::$instance === false) {
self::$instance = new self();
}
return self::$instance;
}
示例8: getLogger
static function getLogger()
{
if (self::$instance == null) {
self::$instance = new Logger("logger");
}
return self::$instance;
}
示例9: get
public static function get()
{
if (self::$instance == null) {
self::$instance = new self();
}
return self::$instance;
}
示例10: getSingleton
public static function getSingleton($pathData, $pathSep, $file = 'cron.log')
{
if (self::$instance == null) {
self::$instance = new Logger($pathData, $pathSep, $file);
}
return self::$instance;
}
示例11: get_instance
/**
* Singleton, returns class if stored, attemps to call constructor and initilize if not stored
*
* @param PDO|null $loggingDB connection to logging database
* @param string $transactionID unique identifier created at application startup
*/
public static function get_instance(PDO $loggingDB = null, $transactionID = null)
{
if (self::$instance === null) {
self::$instance = new self($loggingDB, $transactionID);
return self::$instance;
}
return self::$instance;
}
示例12: setLogger
/**
*
*
* @param LoggerInterface $value Specify a new value to set the logger to.
*/
public static function setLogger(LoggerInterface $value = null)
{
if ($value !== null) {
self::$instance = $value;
} else {
self::$instance = new BaseLogger();
}
}
示例13: getInstance
public function getInstance()
{
// Instantiate itself if not instantiated
if (self::$instance === NULL) {
self::$instance = new Logger();
}
return self::$instance;
}
示例14: getInstance
protected static function getInstance()
{
if (self::$instance === NULL) {
$class = __CLASS__;
self::$instance = new $class();
}
return self::$instance;
}
示例15: logfile
/**
* Simple static method to log lines to the logfile.
*
* @param string $value message
* @param string $path relative path to temporary directory
* @param boolean $success
* @author sl
*/
public static function logfile($value)
{
if (self::$instance == null) {
self::$instance = new Logger();
}
$value = preg_replace('/\\n|\\s{2,}/i', '', $value);
self::$instance->log($value);
}