-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfluentlogger.php
More file actions
60 lines (55 loc) · 1.22 KB
/
fluentlogger.php
File metadata and controls
60 lines (55 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
*/
/**
* Validate dependancies
*/
if(class_exists("Fluent\\Logger\\FluentLogger") === false)
{
throw new Exception("Please install fluent\\logger to your application root");
}
/**
* Wrapper class for Fluent\Logger interface.
*/
class FluentLogger_Library extends Fluent\Logger\FluentLogger
{
/**
* Applicatyion Config
* @var FluentLogger_Config
*/
protected $logger_config = null;
/**
* Valdiate hte logger is installed
*/
public function __construct()
{
/**
* Read the fluentlogger configuration object
* @var FluentLogger_Config
*/
$this->logger_config = Registry::get("ConfigLoader")->FluentLogger;
/**
* Cal the FluentLogger constructor
*/
parent::__construct(
$this->logger_config->host,
$this->logger_config->port,
$this->logger_config->options
);
}
/**
* Utility log function
*/
public function log($tag, $payload)
{
$this->post($this->logger_config->prefix . "." . $tag, $payload);
}
}