GetLogger: различия между версиями

Материал из MajorDoMo инфо
(Новая страница: «Category:Встроенные функции ==Описание== '''getLogger'''($context = null); -- Method returns logger with meaningful name. In this cas...»)
 
Строка 30: Строка 30:


   return Logger
   return Logger
==Примеры запросов==
==Примеры запросов==



Версия от 14:00, 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

Примеры запросов

Альтернативные названия функции (сленг)

Просто для проверки появления разделов