I have php file which contains class "FooClass" uses in a few projects. I recently add method for logging with log4net like this:
private static function log($message,$level=0)
{
if(!isset(self::$logger))
{
if(!class_exists("Logger")) return;
self::$logger = Logger::getLogger("DBw");
if(!isset(self::$logger)) return;
}
//logging
}
Some files that use FooClass can define the configuration by ising Logger::configure("config.xml"). But others don't define it, and in that case the FooClass start to use LoggerConfiguratorDefault, which trace logs as "echo". This is not acceptable.
I want to see if the configuration is not defined by other files, the FooClass did not log with LoggerConfiguratorDefault.
How can I do disable LoggerConfiguratorDefault or detect using of that and make return from function?