logxpert 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +43 -0
- package/README.fr.md +43 -0
- package/README.md +6 -0
- package/main.js +34 -0
- package/package.json +1 -1
package/README.en.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# LogXpert
|
|
2
|
+
|
|
3
|
+
LogXpert is a powerful logging library for Node.js that provides easy-to-use logging methods with colorful formatted output.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install LogXpert using npm:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install logxpert
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Import LogXpert in your project:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const log = require('logxpert');
|
|
19
|
+
|
|
20
|
+
// Global log
|
|
21
|
+
log('This is a general log message.');
|
|
22
|
+
|
|
23
|
+
// Error log
|
|
24
|
+
log.error('This is an error message.');
|
|
25
|
+
|
|
26
|
+
// Warning log
|
|
27
|
+
log.warn('This is a warning message.');
|
|
28
|
+
|
|
29
|
+
// Info log
|
|
30
|
+
log.info('This is an informational message.');
|
|
31
|
+
|
|
32
|
+
// Debug log
|
|
33
|
+
log.debug('This is a debug message.');
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Project Structure
|
|
37
|
+
|
|
38
|
+
- [main.js](c:\Users\x\Desktop\powerlogs\main.js) - Entry point with the logging functionality.
|
|
39
|
+
- [package.json](c:\Users\x\Desktop\powerlogs\package.json) - Package configuration.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
This project is licensed under the MIT License.
|
package/README.fr.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# LogXpert
|
|
2
|
+
|
|
3
|
+
LogXpert est une bibliothèque de log puissante pour Node.js qui offre des méthodes de log simples à utiliser avec un affichage coloré et formaté.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Installez LogXpert via npm :
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install logxpert
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Utilisation
|
|
14
|
+
|
|
15
|
+
Importez LogXpert dans votre projet :
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const log = require('logxpert');
|
|
19
|
+
|
|
20
|
+
// Log global
|
|
21
|
+
log('Ceci est un message de log général.');
|
|
22
|
+
|
|
23
|
+
// Log d'erreur
|
|
24
|
+
log.error("Ceci est un message d'erreur.");
|
|
25
|
+
|
|
26
|
+
// Log d'avertissement
|
|
27
|
+
log.warn("Ceci est un message d'avertissement.");
|
|
28
|
+
|
|
29
|
+
// Log d'info
|
|
30
|
+
log.info("Ceci est un message d'information.");
|
|
31
|
+
|
|
32
|
+
// Log de debug
|
|
33
|
+
log.debug("Ceci est un message de debug.");
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Structure du Projet
|
|
37
|
+
|
|
38
|
+
- [main.js](c:\Users\x\Desktop\powerlogs\main.js) - Point d'entrée avec la fonctionnalité de log.
|
|
39
|
+
- [package.json](c:\Users\x\Desktop\powerlogs\package.json) - Configuration du package.
|
|
40
|
+
|
|
41
|
+
## Licence
|
|
42
|
+
|
|
43
|
+
Ce projet est sous licence MIT.
|
package/README.md
ADDED
package/main.js
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const colors = {
|
|
2
|
+
reset: "\x1b[0m",
|
|
3
|
+
red: "\x1b[31m",
|
|
4
|
+
yellow: "\x1b[33m",
|
|
5
|
+
cyan: "\x1b[36m",
|
|
6
|
+
magenta: "\x1b[35m",
|
|
7
|
+
white: "\x1b[37m"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function colorText(text, color) {
|
|
11
|
+
return `${color}${text}${colors.reset}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function log(message) {
|
|
15
|
+
console.log(colorText(message, colors.white));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
log.error = function (message) {
|
|
19
|
+
console.error(colorText(`Error: ${message}`, colors.red));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
log.warn = function (message) {
|
|
23
|
+
console.warn(colorText(`Warn: ${message}`, colors.yellow));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
log.info = function (message) {
|
|
27
|
+
console.info(colorText(`Info: ${message}`, colors.cyan));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
log.debug = function (message) {
|
|
31
|
+
console.debug(colorText(`Debug: ${message}`, colors.magenta));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = log;
|