Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- &Log::singleton($handler, $name, $ident, $conf, $maxLevel);
- class Logger {
- private static $log;
- private function __construct() { }
- public static function init(Log $log) {
- self::$log = $log;
- }
- public static function get() {
- return self::$log;
- }
- }
- Logger::get()->doSomething($foo, $bar);
- Logger::Write("Something happened");
- private static $log = null;
- public static function init(Log $log) {
- self::$log = $log;
- }
- public static function Write(String $str) {
- if($log == null)
- init(Log::singleton(...));
- $this->log->Write($str);
- }
Add Comment
Please, Sign In to add comment