loguix/README.md

46 lines
863 B
Markdown
Raw Permalink Normal View History

2023-10-21 15:23:33 +00:00
# Loguix
> Loguix est un petit package qui permet de générer des logs formatés : **[YYYY-MM-DD-hh-mm-ss]**
## Utilisation
2024-01-13 15:09:29 +00:00
> - Dès que vous instanciez le package, configurez une seul fois le dossier de destination des logs
```js
const log = require("loguix")
log.setup("./logs")
```
2023-10-21 15:23:33 +00:00
### 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")
```