GetLogger: различия между версиями
Материал из MajorDoMo инфо
Newz20 (обсуждение | вклад) |
Newz20 (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
[[Category:Встроенные функции]] | [[Category:Встроенные функции]] | ||
==Описание== | ==Описание== | ||
'''ФУНКЦИЯ НЕ РАБОЧАЯ''' | |||
'''getLogger'''($context = null); -- Method returns logger with meaningful name. In this case much easy to enable\disable logs depending on requirements | '''getLogger'''($context = null); -- Method returns logger with meaningful name. In this case much easy to enable\disable logs depending on requirements | ||
Текущая версия от 14:06, 11 декабря 2019
Описание
ФУНКЦИЯ НЕ РАБОЧАЯ
getLogger($context = null); -- Method returns logger with meaningful name. In this case much easy to enable\disable logs depending on requirements
If $context is empty or null, then return root logger
If $context is filename or filepath, then return logger with name 'page.filename'
If $context is string, then return logger with name $context
If $context is object, then depending from object class it returns:
- 'class.object.objectname' - 'class.module.modulename' - 'class.objectclass'
Example of usage:
- $log = getLogger(); - $log = getLogger('MyLogger'); - $log = getLogger(__FILE__); - $log = getLogger($this);
param mixed $context Context (default null)
return Logger