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

Commit 52475ed

Browse files
committed
The repository was updated to version 1.1.1
1 parent 9d0577e commit 52475ed

8 files changed

+766
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
phpunit.xml
2+
composer.phar
3+
composer.lock
4+
composer-test.lock
5+
vendor/
6+
build/artifacts/
7+
artifacts/
8+
docs/_build
9+
docs/*.pyc
10+
.git*/
11+
.idea
12+
.DS_STORE

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# CHANGELOG
2+
3+
## 1.1.1 - 2017-03-18
4+
* Some files were excluded from download and comments and readme files were updated.
5+
6+
## 1.1.0 - 2017-01-30
7+
* Compatible with PHP 5.6 or higher.
8+
9+
## 1.0.0 - 2017-01-30
10+
* Compatible only with PHP 7.0 or higher. In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
11+
12+
## 1.0.0 - 2017-01-21
13+
* Added `Josantonius\Logger\Logger` class.
14+
* Added `Josantonius\Logger\Logger->__construct()` method.
15+
* Added `Josantonius\Logger\Logger->_getLogs()` method.
16+
* Added `Josantonius\Logger\Logger::save()` method.
17+
* Added `Josantonius\Logger\Logger::storeLogs()` method.
18+
* Added `Josantonius\Logger\Logger::_validateLogsNumber()` method.
19+
* Added `Josantonius\Logger\Logger->shutdown()` method.
20+
21+
## 1.0.0 - 2017-01-21
22+
* Added `Josantonius\Logger\Exception\LoggerException` class.
23+
* Added `Josantonius\Logger\Exception\Exceptions` abstract class.
24+
* Added `Josantonius\Logger\Exception\LoggerException->__construct()` method.
25+
26+
## 1.0.0 - 2017-01-21
27+
* Added `Josantonius\Logger\Tests\LoggerTest` class.
28+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLog()` method.
29+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLogWithFilepath()` method.
30+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLogWithLimitLogsNumber()` method.
31+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLogWithUserIP()` method.
32+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLogWithUserCustomStates()` method.
33+
* Added `Josantonius\Logger\Tests\LoggerTest->testSaveLogWithUserCustomParams()` method.
34+
* Added `Josantonius\Logger\Tests\LoggerTest->testDisableLogs()` method.
35+
* Added `Josantonius\Logger\Tests\LoggerTest->testDisableLogsByState()` method.
36+
* Added `Josantonius\Logger\Tests\LoggerTest->testGetLogs()` method.
37+
* Added `Josantonius\Logger\Tests\LoggerTest->testGetLogsFromCustomPath()` method.
38+
* Added `Josantonius\Logger\Tests\LoggerTest->testExceptionCouldCreatePath()` method.

CONDUCT.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct.
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

README-ES.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# PHP Logger library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/logger/v/stable)](https://packagist.org/packages/josantonius/logger) [![Total Downloads](https://poser.pugx.org/josantonius/logger/downloads)](https://packagist.org/packages/josantonius/logger) [![Latest Unstable Version](https://poser.pugx.org/josantonius/logger/v/unstable)](https://packagist.org/packages/josantonius/logger) [![License](https://poser.pugx.org/josantonius/logger/license)](https://packagist.org/packages/josantonius/logger)
4+
5+
[Spanish version](README-ES.md)
6+
7+
Librería php para crear logs fácilmente y almacenarlos en formato Json.
8+
9+
---
10+
11+
- [Instalación](#instalación)
12+
- [Requisitos](#requisitos)
13+
- [Cómo empezar y ejemplos](#cómo-empezar-y-ejemplos)
14+
- [Métodos disponibles](#métodos-disponibles)
15+
- [Uso](#uso)
16+
- [Tests](#tests)
17+
- [Manejador de excepciones](#manejador-de-excepciones)
18+
- [Contribuir](#contribuir)
19+
- [Repositorio](#repositorio)
20+
- [Licencia](#licencia)
21+
- [Copyright](#copyright)
22+
23+
---
24+
25+
### Instalación
26+
27+
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
28+
29+
Para instalar PHP Logger library, simplemente escribe:
30+
31+
$ composer require Josantonius/Logger
32+
33+
El comando anterior solamente instalará los archivos necesarios, si prefieres descargar todo el código, incluyendo tests, puedes utilizar:
34+
35+
$ composer require Josantonius/Logger --prefer-source
36+
37+
También puedes clonar el repositorio completo con Git:
38+
39+
$ git clone https://github.com/Josantonius/PHP-Logger.git
40+
41+
### Requisitos
42+
43+
Esta ĺibrería es soportada por versiones de PHP 5.6 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
44+
45+
### Cómo empezar y ejemplos
46+
47+
Para utilizar esta librería, simplemente:
48+
49+
```php
50+
require __DIR__ . '/vendor/autoload.php';
51+
52+
use Josantonius\Logger\Logger;
53+
```
54+
### Métodos disponibles
55+
56+
Métodos disponibles en esta librería:
57+
58+
```php
59+
Logger::save();
60+
Logger::storeLogs();
61+
Logger->shutdown();
62+
```
63+
### Uso
64+
65+
Ejemplo de uso para esta librería:
66+
67+
```php
68+
<?php
69+
require __DIR__ . '/vendor/autoload.php';
70+
71+
use Josantonius\Logger\Logger;
72+
73+
new Logger();
74+
75+
Logger::save('JOIN', 800, 100, 'Your message here', __LINE__, __FILE__);
76+
Logger::save('INFO', 801, 200, 'Your message here', __LINE__, __FILE__);
77+
Logger::save('WARNING', 802, 300, 'Your message here', __LINE__, __FILE__);
78+
Logger::save('ERROR', 803, 400, 'Your message here', __LINE__, __FILE__);
79+
Logger::save('FATAL', 804, 500, 'Your message here', __LINE__, __FILE__);
80+
81+
Logger::storeLogs();
82+
83+
echo '<pre>'; var_dump(Logger::$logs); echo '</pre>';
84+
85+
/*
86+
array(1) {
87+
[0]=>
88+
array(14) {
89+
["ip"]=>
90+
string(3) "158.54.12.100"
91+
["uri"]=>
92+
string(5) "/folder/"
93+
["referer"]=>
94+
string(7) "http://www.referer.es/"
95+
["remote-port"]=>
96+
int(47290)
97+
["ip-server"]=>
98+
string(3) "188.254.112.200"
99+
["user-agent"]=>
100+
string(133) "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/5.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.23.87 Chrome/55.0.23.87 Safari/5.36"
101+
["type"]=>
102+
string(4) "join"
103+
["state"]=>
104+
int(800)
105+
["code"]=>
106+
string(3) "100"
107+
["message"]=>
108+
string(17) "Visit the page"
109+
["line"]=>
110+
int(572)
111+
["file"]=>
112+
string(44) "/var/www/localhost/public_html/folder/index.php"
113+
["hour"]=>
114+
string(8) "20:58:18"
115+
["date"]=>
116+
string(10) "2017-01-21"
117+
}
118+
}
119+
*/
120+
```
121+
122+
### Tests
123+
124+
Para utilizar la clase de [pruebas](tests), simplemente:
125+
126+
```php
127+
<?php
128+
$loader = require __DIR__ . '/vendor/autoload.php';
129+
130+
$loader->addPsr4('Josantonius\\Logger\\Tests\\', __DIR__ . '/vendor/josantonius/logger/tests');
131+
132+
use Josantonius\Logger\Tests\LoggerTest;
133+
```
134+
Métodos de prueba disponibles en esta librería:
135+
136+
```php
137+
LoggerTest->testSaveLog();
138+
LoggerTest->testSaveLogWithFilepath();
139+
LoggerTest->testSaveLogWithLimitLogsNumber();
140+
LoggerTest->testSaveLogWithUserIP();
141+
LoggerTest->testSaveLogWithUserCustomStates();
142+
LoggerTest->testSaveLogWithUserCustomParams();
143+
LoggerTest->testDisableLogs();
144+
LoggerTest->testDisableLogsByState();
145+
LoggerTest->testGetLogs();
146+
LoggerTest->testGetLogsFromCustomPath();
147+
LoggerTest->testExceptionCouldCreatePath();
148+
```
149+
150+
### Manejador de excepciones
151+
152+
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
153+
### Contribuir
154+
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
155+
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.
156+
1. Escribe una o más pruebas para la nueva característica o expón el error.
157+
1. Haz cambios en el código para implementar la característica o reparar el fallo.
158+
1. Envía pull request para fusionar los cambios y que sean publicados.
159+
160+
Esto está pensado para proyectos grandes y de larga duración.
161+
162+
### Repositorio
163+
164+
Los archivos de este repositorio se crearon y subieron automáticamente con [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
165+
166+
### Licencia
167+
168+
Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.
169+
170+
## Copyright
171+
172+
2017 Josantonius, [josantonius.com](https://josantonius.com/)
173+
174+
Si te ha resultado útil, házmelo saber :wink:
175+
176+
Puedes contactarme en [Twitter](https://twitter.com/Josantonius) o a través de mi [correo electrónico](mailto:[email protected]).

0 commit comments

Comments
 (0)