Skip to content

Commit 77be342

Browse files
authored
Merge pull request #1 from ABGEO07/develope
Develope
2 parents ce96bf4 + fbab321 commit 77be342

File tree

9 files changed

+1829
-13
lines changed

9 files changed

+1829
-13
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
var
2+
23
vendor
4+
5+
phpunit.xml
6+
*.phpunit.result.cache
7+
tests/unit/logs

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Cherry-logger Changelog
2+
3+
## [v1.0.0](https://github.com/ABGEO07/cherry-logger/compare/v0.9.5...v1.0.0 "v1.0.0") (2019-02-28)
4+
#### The first Stable version
5+
#### Additions
6+
- You can call more then one method from one object;
7+
- Added **Debug** log type
8+
- Added logs count getting feature;
9+
- Added logs clearing feature;
10+
- Added PHPUnit Tests;
11+
12+
## [v0.9.5](https://github.com/ABGEO07/cherry-logger/compare/v0.9...v0.9.5 "v0.9.5") (2019-02-27)
13+
### Additions
14+
- Added logger naming feature. You can set name for each logger instance.
15+
16+
## [v0.9](https://github.com/ABGEO07/cherry-logger/releases/tag/v0.9 "v0.9") (2019-02-26)
17+
#### The first Major version
18+
19+
- Package available on: `composer require cherry-project/logger`
20+
21+
- Logger methods
22+
- info
23+
- warning
24+
- error

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2729
Logger 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 &copy; Temuri Takalandze <[email protected]>**

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
],
1616
"minimum-stability": "dev",
1717
"require": {
18-
"php": ">=5.6.0"
18+
"php": ">=5.6.0",
19+
"phpunit/phpunit": "^8.0"
1920
},
2021
"autoload": {
2122
"psr-4": {

0 commit comments

Comments
 (0)