@@ -5,6 +5,8 @@ The Cherry-project logger
55
66[ ![ GitHub release] ( https://img.shields.io/github/release/abgeo07/cherry-logger.svg )] ( https://github.com/ABGEO07/cherry-logger/releases )
77
8+ [ ![ Packagist Version] ( https://img.shields.io/packagist/v/cherry-project/logger.svg " Packagist Version ")] ( https://packagist.org/packages/cherry-project/logger " Packagist Version ")
9+
810------------
911
1012## Including
@@ -25,20 +27,47 @@ define('LOGS_DIR', __DIR__ . '/var/log');
2527** Crete class new object**
2628
2729Logger class takes two arguments:
28- - Log Name, the logs filename( ** {LogName}.log** ). (Default ** 'app'** )
29- - Logs Directory. (Default ** '/var/log'** )
30+ - Log Name, the logs filename ** {LogName}.log** (Default ** 'app'** ).
31+ - Logs Directory(Default ** '/var/log'** ).
3032``` php
3133$logger = new Logger('app-logs', LOGS_DIR);
3234```
3335
3436## Logger methods
35- The logger has 3 methods (Log types): info, warning, error;
37+ The logger has 4 Log types:
38+ - ** info()** ;
39+ - ** warning()** ;
40+ - ** error()** ;
41+ - ** debug()**
42+
43+ and additional methods:
44+ - ** clear()** clear logs in current instance;
45+ - ** count()** get logs count in current instance;
3646
3747### Call methods
3848``` php
3949$logger->info('Info Message');
4050$logger->warning('Warning Message');
4151$logger->error('Error Message');
52+ $logger->debug('Debug Message');
53+ ```
54+
55+ Also you can call more then one method from one object:
56+ ``` php
57+ $logger->info('Info Message 2')
58+ ->warning('Warning Message 2')
59+ ->error('Error Message 2')
60+ ->debug('Debug Message 2');
61+ ```
62+
63+ If you need logs count in current instance, you might use ** count()** method:
64+ ``` php
65+ echo $logger->count();
66+ ```
67+
68+ You can clear all the logs in the current instance using the ** clear()** method:
69+ ``` php
70+ $logger->clear();
4271```
4372
4473** 2019
© ; Temuri Takalandze
< [email protected] > **
0 commit comments