Example #1
0
 protected function __construct($config = array())
 {
     // override default format if no formating is given
     $this->_format = '<script>window.console && console.log("[{level}] {message}");</script>';
     // create it
     parent::__construct($config);
 }
Example #2
0
 protected function __construct($config = array())
 {
     // override default format if no formating is given
     $this->_format = '<div class="{level}">[{level}] {message}</div>';
     // create it
     parent::__construct($config);
 }
Example #3
0
File: File.php Project: rezon/sugi
 /**
  * Class constructor
  * 
  * @param array $config - the key 'filename' is a must
  */
 public function __construct($config = array())
 {
     // overriding default format
     $this->_format = '[{Y}-{m}-{d} {H}:{i}:{s}] [{ip}] [{level}] {message}';
     // create it
     parent::__construct($config);
     // custom settings
     if (isset($config['filename'])) {
         $this->_filename = $config['filename'];
     } else {
         throw new \Exception("filename parameter is not provided in the config");
     }
     if (isset($config['filemode'])) {
         $this->_filemode = $config['filemode'];
     }
 }
Example #4
0
 /**
  * Class constructor
  */
 public function __construct($config)
 {
     // overriding default format
     $this->_format = "{'level': '{level}', 'message': '{message}', 'time': '{Y}-{m}-{d} {H}:{i}:{s}', 'ip': '{ip}'}";
     // create it
     parent::__construct($config);
     // custom config
     if (isset($config['url'])) {
         $this->_url = $config['url'];
     } else {
         throw new \Exception('url parameter is not provided in the config');
     }
     if (isset($config['json'])) {
         $this->_json = $config['json'];
     }
 }