Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kikimarik/lognote
Standard PHP library for logging
https://github.com/kikimarik/lognote
log php
Last synced: 10 days ago
JSON representation
Standard PHP library for logging
- Host: GitHub
- URL: https://github.com/kikimarik/lognote
- Owner: kikimarik
- License: mit
- Created: 2022-06-15T10:16:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T12:33:03.000Z (over 2 years ago)
- Last Synced: 2024-11-07T08:36:30.943Z (2 months ago)
- Topics: log, php
- Language: PHP
- Homepage:
- Size: 49.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Lognote - standard PHP library for logging
## Features
***
- Object-oriented design (without static methods etc.)
- Compatible with PHP 7.1 and later, including PHP 8.1
- Support for the `json` format
- Ability to write log into the file or print to console output## Why do you need it
***
The library helps PHP developers to log their application events at different levels. 6 levels have been implemented: errors, warnings, info, fatal, notice and debug.`Lognote` has a nice object-oriented design and it is going to please you with its simplicity. Before testing a class that depends on that library component, it is easy to replace that dependency with a fake class.
## A Simple Example
***```php
receiveInfo(new MessageLogLine("Start script info"));
$log->receiveWarning(new MessageLogLine("I`m the warning example"));
$log->receiveInfo(new MessageLogLine("End script info"));
/**
* It will create file example.log in current dir with content like:
{"date":"2022-06-15 19:25:10","level":"info","message":"Start script info"}
{"date":"2022-06-15 19:25:10","level":"warning","message":"I`m the warning example"}
{"date":"2022-06-15 19:25:10","level":"info","message":"End script info"}
*/
```## License
***
This software is distributed under the MIT license.## Installation
***
- via composer `composer require kikimarik/lognote`## Tests
***
[Lognote tests](https://github.com/kikimarik/lognote/tree/master/tests) use the [Codeception 4.2.0](https://github.com/Codeception/Codeception/tree/4.2.0) framework.
All unit tests must be passed.For tests running you can run the command:
`./vendor/bin/codecept run`