Skip to content
This repository was archived by the owner on Aug 18, 2022. It is now read-only.

Commit 50e4315

Browse files
committed
Updated to 1.1.5 version
1 parent c82c7b8 commit 50e4315

File tree

18 files changed

+118
-205
lines changed

18 files changed

+118
-205
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ README-ES.md export-ignore
1616
composer.lock export-ignore
1717
phpcs.xml export-ignore
1818
phpunit.xml export-ignore
19-
phpmd.xml export-ignore
19+
phpmd.xml export-ignore
20+
.php_cs.dist export-ignore

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 1.1.5 - 2018-01-06
4+
5+
* The tests were fixed.
6+
7+
* Changes in documentation.
8+
39
## 1.1.4 - 2017-11-09
410

511
* Implemented `PHP Mess Detector` to detect inconsistencies in code styles.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright (c) `2017` `Josantonius, https://josantonius.com <hello@josantonius.com>`
4+
Copyright (c) `2017 - 2018` `Josantonius, https://josantonius.com <hello@josantonius.com>`
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of
77
this software and associated documentation files (the "Software"), to deal in

README-ES.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ Ejecutar todas las pruebas anteriores:
279279
280280
## ☑ Tareas pendientes
281281
282-
- [ ] Añadir nueva funcionalidad
283-
- [ ] Mejorar pruebas
284-
- [ ] Mejorar documentación
285-
- [ ] Refactorizar código
282+
- [ ] Añadir nueva funcionalidad.
283+
- [ ] Mejorar pruebas.
284+
- [ ] Mejorar documentación.
285+
- [ ] Refactorizar código para las reglas de estilo de código deshabilitadas. Ver [phpmd.xml](phpmd.xml) y [.php_cs.dist](.php_cs.dist).
286286
287287
## Contribuir
288288
@@ -309,7 +309,7 @@ Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICEN
309309
310310
## Copyright
311311
312-
2017 Josantonius, [josantonius.com](https://josantonius.com/)
312+
2017 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
313313
314314
Si te ha resultado útil, házmelo saber :wink:
315315

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ Run all previous tests:
279279
280280
## ☑ TODO
281281
282-
- [ ] Add new feature
283-
- [ ] Improve tests
284-
- [ ] Improve documentation
285-
- [ ] Refactor code
282+
- [ ] Add new feature.
283+
- [ ] Improve tests.
284+
- [ ] Improve documentation.
285+
- [ ] Refactor code for disabled code style rules. See [phpmd.xml](phpmd.xml) and [.php_cs.dist](.php_cs.dist).
286286
287287
## Contribute
288288
@@ -309,7 +309,7 @@ This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file
309309
310310
## Copyright
311311
312-
2017 Josantonius, [josantonius.com](https://josantonius.com/)
312+
2017 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
313313
314314
If you find it useful, let me know :wink:
315315

gulpfile.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ var gulp = require('gulp'),
2525

2626
gulp.task('js', function () {
2727

28-
var file = 'public/js/source/logger.js',
28+
var file = 'src/public/js/source/logger.js',
2929
min = 'logger.min.js',
30-
dest = 'public/js/',
30+
dest = 'src/public/js/',
3131

3232
notifyOptions = {
3333

@@ -43,10 +43,10 @@ gulp.task('js', function () {
4343

4444
gulp.task('css', function () {
4545

46-
var main = 'public/sass/logger.sass',
47-
files = 'public/sass/**/*.sass',
48-
source = 'public/css/source/',
49-
dest = 'public/css/',
46+
var main = 'src/public/sass/logger.sass',
47+
files = 'src/public/sass/**/*.sass',
48+
source = 'src/public/css/source/',
49+
dest = 'src/public/css/',
5050

5151
sourcemapsOption = {
5252

@@ -107,12 +107,12 @@ gulp.task('css', function () {
107107
gulp.task('watch', function () {
108108

109109
var sassFiles = [
110-
'public/sass/**/*.sass',
111-
'public/sass/logger.sass'
110+
'src/public/sass/**/*.sass',
111+
'src/public/sass/logger.sass'
112112
],
113113

114114
jsFiles = [
115-
'public/js/source/logger.js'
115+
'src/public/js/source/logger.js'
116116
];
117117

118118
gulp.watch(jsFiles, ['js']);

src/Logger.php

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* PHP library to create logs easily and store them in Json format.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2017 (c) Josantonius - PHP-Logger
6+
* @copyright 2017 - 2018 (c) Josantonius - PHP-Logger
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-Logger
99
* @since 1.0.0
@@ -14,88 +14,68 @@
1414

1515
/**
1616
* Logger handler.
17-
*
18-
* @since 1.0.0
1917
*/
2018
class Logger
2119
{
2220
/**
2321
* Path to save logs.
2422
*
25-
* @since 1.0.0
26-
*
2723
* @var string
2824
*/
2925
protected static $path;
3026

3127
/**
3228
* File to save logs.
3329
*
34-
* @since 1.0.0
35-
*
3630
* @var string
3731
*/
3832
protected static $filepath;
3933

4034
/**
4135
* Current file name that is saved in the log.
4236
*
43-
* @since 1.0.0
44-
*
4537
* @var string
4638
*/
4739
protected static $filename;
4840

4941
/**
5042
* Contents of the current log.
5143
*
52-
* @since 1.0.0
53-
*
5444
* @var array
5545
*/
5646
protected static $log;
5747

5848
/**
5949
* Array with logs.
6050
*
61-
* @since 1.0.0
62-
*
6351
* @var array
6452
*/
6553
protected static $logs = null;
6654

6755
/**
6856
* Maximum number of saved logs.
6957
*
70-
* @since 1.0.0
71-
*
7258
* @var int
7359
*/
7460
protected static $logNumber;
7561

7662
/**
7763
* Counter logs.
7864
*
79-
* @since 1.0.0
80-
*
8165
* @var int
8266
*/
8367
protected static $counterLogs = 0;
8468

8569
/**
8670
* Different states for logs.
8771
*
88-
* @since 1.0.0
89-
*
9072
* @var string
9173
*/
9274
protected static $states;
9375

9476
/**
9577
* Initiator for site debug management.
9678
*
97-
* @since 1.0.0
98-
*
9979
* @param string $path → path name to save file with logs
10080
* @param string $filename → json file name that will save the logs
10181
* @param int $logNumber → maximum number of logs to save to file
@@ -119,8 +99,6 @@ public function __construct($path = null, $filename = null, $logNumber = 200, $i
11999
/**
120100
* Save log line.
121101
*
122-
* @since 1.0.0
123-
*
124102
* @param string $type → error type or warning
125103
* @param int $code → HTTP response status code
126104
* @param string $message → message
@@ -158,8 +136,6 @@ public static function save($type, $code, $msg, $line, $file, $data = 0)
158136
/**
159137
* Save logs to Json file.
160138
*
161-
* @since 1.0.0
162-
*
163139
* @uses \Json::arrayToFile() → create JSON file from array
164140
*
165141
* @return bool
@@ -246,7 +222,7 @@ public static function render()
246222
{
247223
$path = dirname(__DIR__);
248224

249-
require_once $path . '/public/template/logger.php';
225+
require_once $path . '/src/public/template/logger.php';
250226

251227
return true;
252228
}
@@ -273,8 +249,6 @@ public static function reset()
273249

274250
/**
275251
* Method that will be called in case of to register shutdown.
276-
*
277-
* @since 1.0.0
278252
*/
279253
public function shutdown()
280254
{
@@ -329,7 +303,7 @@ private static function setFile($filename, $type, $pathUrl)
329303
}
330304

331305
$path = rtrim(dirname(__DIR__), '/') . '/';
332-
$from = $path . 'public/' . $ext . "/$filename.$ext";
306+
$from = $path . 'src/public/' . $ext . "/$filename.$ext";
333307
$file = file_get_contents($from);
334308

335309
file_put_contents($toPath, $file);
@@ -429,8 +403,6 @@ private function setStates($states)
429403

430404
/**
431405
* Validate maximum logs number.
432-
*
433-
* @since 1.0.0
434406
*/
435407
private static function validateLogsNumber()
436408
{
File renamed without changes.
File renamed without changes.

public/css/source/logger.css renamed to src/public/css/source/logger.css

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)