Update Log:1.0 notice

This commit is contained in:
xdrm-brackets 2017-09-09 17:56:58 +02:00
parent 61b74d5bcf
commit 42c9f91b24
1 changed files with 14 additions and 17 deletions

View File

@ -1,7 +1,8 @@
```yaml ```yaml
module: log module: log
version: 1.0 version: 1.0
requires: null requires:
- filedriver: 1.0
``` ```
Overview Overview
@ -23,17 +24,7 @@ Log files are located at `/build/log/log/{logfile}.php`.
Usage Usage
---- ----
> 1. Include the autoloader > ### 1. Load the `Log` class
```php
<?php
require_once '../autoloader.php';
...
```
> 2. Load the `Log` class
```php ```php
<?php <?php
@ -44,26 +35,32 @@ Usage
``` ```
> 3. Fetch the log file you want (_"error"_ in this example) > ### 2. Select the log file you want
```php ```php
<?php <?php
... ...
/* Selects the 'error' log file
*
* The target file is /build/log/log/error.log
*/
Log::get('error'); Log::get('error');
... ...
``` ```
> 3. log something on a specific log file (_"error"_ in this example) Note: If you do not give any argument to the `Log::get` method, it will use `default` as default.
> ### 3. log something on a specific log file (_"error"_ in this example)
```php ```php
<?php <?php
... ...
/* Logs a new entry into the log file /build/log/log/error.log */
Log::get('error')->log('some message', 'optional_tag'); Log::get('error')->log('some message', 'optional_tag');
... ...
``` ```
Note: If the `message` argument is missing, it will be `...` by default, the tag if not set will be `default`.