Log::_init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Fluentd;
4
5
class Log extends \Fuel\Core\Log
6
{
7
	protected static $opensocial_user_id = '';
8
	
9
	public static function setOpensocialUserId($opensocial_user_id) {
10
		self::$opensocial_user_id = $opensocial_user_id;
11
	}
12
13
	public static function _init() {
14
		\Config::load('log', true);
15
	}
16
17
	public static function info($msg, $method = null)
18
	{
19
		return static::write(\Fuel::L_INFO, $msg, $method);
20
	}
21
22
	public static function write($level, $msg, $method = null) {
23
24
		\Config::load('log', true);
25
		$config = \Config::get('log', array());
26
		
27
		if (empty($config['driver']))
28
		{
29
			throw new \FuelException('No log driver given or no default log driver set.');
30
		}
31
32
		$class = 'Fluentd\\Log\\'.ucfirst($config['driver']);
33
		
34
		try {
35
			return $class::write($level, $msg, $method);
36
		} catch (\FuelException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
Bug introduced by
The class FuelException does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
37
		}
38
	}
39
}
40