In Java, I use log4J, which is the basis of logging. In Log4j, you can do something like this:
if (log.isDebug()) {
// do some expensive operation that should only be displayed if DEBUG is turned on
}
After reading some Symfony examples, I cannot find a way to determine if DEBUG logging is activated in the context of the current class. Is there any way to do this?
if (--need something here--) {
$this->logMessage('Expensive operation return value: '.expensiveFunction(), 'debug');
}
source
share