-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GonzoInc
committed
Nov 8, 2018
0 parents
commit 1bdc584
Showing
13 changed files
with
2,595 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Ignore the following files | ||
.settings | ||
.project | ||
.DS_Store | ||
.idea/* | ||
/vendor/ | ||
/logs/* | ||
/logs/codeSniffReport.txt |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# GLogger | ||
|
||
Project created by [Greg Dean](https://github.com/gonzoinc) | ||
|
||
## About | ||
|
||
Glogger is a simple logger class implementing [Klogger](https://github.com/katzgrau/KLogger). It's basically a wrapper. The purpose of this was a simpler way to use Klogger throughout an application. Constants are now used which allows easier management, configurability and ease of use. | ||
|
||
## Installation | ||
|
||
Installation is done strictly with Composer and loaded with it's autoload feature. | ||
|
||
```bash | ||
composer require gonzoinc/glogger | ||
``` | ||
In your `composer.json`: | ||
|
||
``` json | ||
{ | ||
"require": { | ||
"gonzoinc/glogger": "1.0.0" | ||
} | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Check Sample file for working example of the class and examples of the various logging levels. | ||
|
||
The Constants used are defined in the init.php file. Be sure to copy them over to your application and set them as needed. | ||
|
||
```php | ||
|
||
<?php | ||
|
||
require_once "init.php"; | ||
|
||
// Composer required modules | ||
require_once 'vendor/autoload.php'; | ||
|
||
use Glogger\Log; | ||
|
||
$logger = new Log(); | ||
|
||
$logger->debug("This is a debug message"); | ||
|
||
$logger->warn("This is a warning message"); | ||
|
||
$logger->info("This is an info message"); | ||
|
||
$logger->error("This is an error message"); | ||
|
||
$logger->critical("This is a critical message"); | ||
``` | ||
The logger class is set to create the log file in a JSON logstash format. This was personal taste since I use elasticsearch to consume all my logs. | ||
|
||
## Contributing | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
|
||
Please make sure to update tests as appropriate. *** PHPUnit Tests are to Follow *** | ||
|
||
## License | ||
[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "gonzoinc/glogger", | ||
"description": "Simple logger class implementing klogger", | ||
"type": "project", | ||
"authors": [ | ||
{ | ||
"name": "Gonzo Inc", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6.4", | ||
"katzgrau/klogger": "^1.2.1" | ||
}, | ||
"require-dev": { | ||
"squizlabs/php_codesniffer": "3.*", | ||
"phpunit/phpunit": "^5.0.0" | ||
}, | ||
"minimum-stability": "stable", | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"bash scripts/composer/setUpHooks.sh" | ||
], | ||
"test-standards": "phpcs", | ||
"test": [ | ||
"@test-standards" | ||
] | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Glogger\\": "src/Logger/" | ||
} | ||
} | ||
} |
Oops, something went wrong.