GetLogger
Материал из MajorDoMo инфо
Описание
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