forked from ankane/exceptional-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.php
More file actions
39 lines (35 loc) · 724 Bytes
/
Logger.php
File metadata and controls
39 lines (35 loc) · 724 Bytes
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
<?php
namespace OBV\Component\Exceptional;
/**
* @file
* @since 18.11.13 22:24 GMT+2
* @author GG Team <gg@team.tld>
*/
/**
* Class Logger
*
* @package OBV\Component\Exceptional
*/
class Logger
{
/**
* Log compressed data
*
* @param string $data
*/
public static function log($data)
{
if ($directory = Exceptional::getLogDirectory()) {
file_put_contents(tempnam($directory, 'eio-'), $data, FILE_APPEND);
}
}
/**
* Find all postponed log reports
*
* @return array
*/
public static function getLogFiles()
{
return ($directory = Exceptional::getLogDirectory()) ? glob($directory . '/eio-*') : array();
}
}