40 lines
821 B
Markdown
40 lines
821 B
Markdown
# Loguix
|
|
|
|
> Loguix est un petit package qui permet de générer des logs formatés : **[YYYY-MM-DD-hh-mm-ss]**
|
|
|
|
|
|
## Utilisation
|
|
|
|
> - Dès que vous instanciez le package, un dossier `./logs` est crée dans lequels les fichiers journaux vont s'ajouter
|
|
|
|
### Fonctions principales
|
|
|
|
```js
|
|
const MyLogSection = new LogType("Mon nom de section")
|
|
|
|
// Affiche une information
|
|
MyLogSection.log('.....')
|
|
|
|
// Affiche un avertissement
|
|
MyLogSection.warn('.....')
|
|
|
|
// Affiche une erreur
|
|
MyLogSection.error('.....')
|
|
|
|
```
|
|
|
|
### Etapes (Steps)
|
|
|
|
```js
|
|
const MyLogSection = new LogType("Mon nom de section")
|
|
|
|
// Affiche une information
|
|
MyLogSection.step.init('identifiant', ".....")
|
|
|
|
// Affiche un avertissement
|
|
MyLogSection.step.end('identifiant')
|
|
|
|
// Affiche une erreur
|
|
MyLogSection.step.error('identifiant', "Descritpion de l'erreur")
|
|
|
|
``` |