updated README + init notice for log:1.0
This commit is contained in:
parent
037cdd3948
commit
e376d1e89e
|
@ -56,6 +56,10 @@ xdrm-framework is based on `all in config` so you will have this structure :
|
||||||
> version 2.0 - [documentation](/notice/api/2.0.md)
|
> version 2.0 - [documentation](/notice/api/2.0.md)
|
||||||
> version 2.2 - [documentation](/notice/api/2.2.md)
|
> version 2.2 - [documentation](/notice/api/2.2.md)
|
||||||
|
|
||||||
|
#### 3.2 Log - multilog system
|
||||||
|
|
||||||
|
> version 1.0 - [documentation](/notice/log/1.0.md)
|
||||||
|
|
||||||
|
|
||||||
#### [3.2] error - error system
|
#### [3.2] error - error system
|
||||||
#### [3.3] database - database wrapper and repository manager
|
#### [3.3] database - database wrapper and repository manager
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
```yaml
|
||||||
|
module: log
|
||||||
|
version: 1.0
|
||||||
|
requires: null
|
||||||
|
```
|
||||||
|
|
||||||
|
Overview
|
||||||
|
----
|
||||||
|
|
||||||
|
##### 1. Introduction
|
||||||
|
The `log` package allows you to manage multiple log files through simple code.
|
||||||
|
|
||||||
|
|
||||||
|
##### 2. Log format
|
||||||
|
> `timestamp | date | [tag] logmessage`
|
||||||
|
|
||||||
|
Example:
|
||||||
|
> `1481495961 | 2016-12-21 23:39:21 | [api_error] some content message`
|
||||||
|
|
||||||
|
##### 3. Log file location
|
||||||
|
Log files are located at `/build/log/log/{logfile}.php`.
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
----
|
||||||
|
> 1. Include the autoloader
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once '../autoloader.php';
|
||||||
|
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
> 2. Load the `Log` class
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
use \log\core\Log;
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
> 3. Fetch the log file you want (_"error"_ in this example)
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
Log::get('error');
|
||||||
|
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
> 3. log something on a specific log file (_"error"_ in this example)
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
Log::get('error')->log('some message', 'optional_tag');
|
||||||
|
|
||||||
|
...
|
||||||
|
```
|
Loading…
Reference in New Issue