ntlogger 2.2.1 → 2.2.3
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.md +5 -3
- package/index.js +58 -1
- package/lib/logger.js +2 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install ntlogger
|
|
|
24
24
|
|
|
25
25
|
```javascript
|
|
26
26
|
// Import the logger
|
|
27
|
-
const logger = require('
|
|
27
|
+
const logger = require('ntlogger');
|
|
28
28
|
|
|
29
29
|
// Create a logger instance
|
|
30
30
|
const log = logger('MyApp');
|
|
@@ -41,10 +41,12 @@ log.internal('Internal message');
|
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Output
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
Check out [Quick Start](https://github.com/NightSquawk/NightTimeLogger/blob/main/examples/quick-start.js)
|
|
45
46
|

|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
Check out [Full Configuration](https://github.com/NightSquawk/NightTimeLogger/blob/main/examples/full-configuration.js)
|
|
48
50
|

|
|
49
51
|
|
|
50
52
|
## Configuration Options
|
package/index.js
CHANGED
|
@@ -1 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* ntlogger
|
|
3
|
+
* Copyright(c) 2024 Kevin R
|
|
4
|
+
* GPL-3.0 Licensed
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Change Log:
|
|
9
|
+
*
|
|
10
|
+
* v2.2.3 - 04/01/2024:
|
|
11
|
+
* Reduced GitHub Actions to only NPM publish
|
|
12
|
+
* Fixed export
|
|
13
|
+
* Modified readme and examples
|
|
14
|
+
*
|
|
15
|
+
* v2.2.2 - 03/31/2024:
|
|
16
|
+
* Take 2 on setting up CI with GitHub Actions to NPM
|
|
17
|
+
* Housekeeping
|
|
18
|
+
*
|
|
19
|
+
* v2.2.1 - 03/31/2024:
|
|
20
|
+
* Tried and failed to setup CI with GitHub Actions to NPM
|
|
21
|
+
*
|
|
22
|
+
* v2.2.0 - 03/31/2024:
|
|
23
|
+
* Renamed project to NightTimeLogger, no longer a daytime logger (old name was Nightly-Logger)
|
|
24
|
+
* Published the project on NPM
|
|
25
|
+
* Added a location parameter to the logger function
|
|
26
|
+
* Modified the logger instance creation to include the location in the metadata
|
|
27
|
+
* Added a map to store logger instances by location instead of one global instance
|
|
28
|
+
* This allows the location to be included in the metadata of each log statement
|
|
29
|
+
* Added a custom 'internal' log level to log internal messages
|
|
30
|
+
* Shortened the output by removing Session from Session ID to increase line availability for messages
|
|
31
|
+
* Increased log level padding to 8 characters to ensure consistent spacing
|
|
32
|
+
* (this looks a bit weird, not sure if I like it but I also tried centered log levels and it no look good :( )
|
|
33
|
+
* Added many configuration options to the logger function (level, internal, console, file, filename, path, maxSize, maxFiles, timestamp)
|
|
34
|
+
*
|
|
35
|
+
* TODO: locations has a weird bug that carries location from instance to instance, ONLY, when another instanced is called
|
|
36
|
+
* from a different file. I have no idea why this is happening.
|
|
37
|
+
* i.e. app.js calls route.js then back to app.js but the location is still route.js. This does not happen when directly
|
|
38
|
+
* calling route.js.
|
|
39
|
+
* TODO: probably rewrite the whole thing to improve readability and maintainability
|
|
40
|
+
* TODO: cry
|
|
41
|
+
* TODO: timestamp, filename have not been tested nor implemented
|
|
42
|
+
*
|
|
43
|
+
* v2.1.0 - 03/17/2024:
|
|
44
|
+
* Modified custom log colors to use ANSI escape codes
|
|
45
|
+
* Changed the console formatter to paint the level and message with the corresponding color
|
|
46
|
+
* Modified the color generation formula. Now with prettier colors!
|
|
47
|
+
*
|
|
48
|
+
* v2.0.0 - 01/20/2024:
|
|
49
|
+
* Added bright color generation
|
|
50
|
+
* Added session ID generation
|
|
51
|
+
* Added separate console and file formatters
|
|
52
|
+
* Added rotating file transport with 5 files of 1MB each (5MB total)
|
|
53
|
+
*
|
|
54
|
+
* v1.0.0 - 10/18/2023:
|
|
55
|
+
* Initial release
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
module.exports = require('./lib/logger');
|
package/lib/logger.js
CHANGED
|
@@ -6,43 +6,9 @@
|
|
|
6
6
|
* any Node.js project.
|
|
7
7
|
*
|
|
8
8
|
* Author: Kevin R. (Kvrnn#6940, Syntax#5569)
|
|
9
|
-
* Date:
|
|
10
|
-
* Current Version: 2.1.
|
|
9
|
+
* Date: 03/31/2024
|
|
10
|
+
* Current Version: 2.1.2
|
|
11
11
|
* License: GPL-3.0
|
|
12
|
-
*
|
|
13
|
-
* Change Log:
|
|
14
|
-
* v2.2.0 - 03/31/2024:
|
|
15
|
-
* Renamed project to NightTimeLogger, no longer a daytime logger (old name was Nightly-Logger)
|
|
16
|
-
* Published the project on NPM
|
|
17
|
-
* Added a location parameter to the logger function
|
|
18
|
-
* Modified the logger instance creation to include the location in the metadata
|
|
19
|
-
* Added a map to store logger instances by location instead of one global instance
|
|
20
|
-
* This allows the location to be included in the metadata of each log statement
|
|
21
|
-
* Added a custom 'internal' log level to log internal messages
|
|
22
|
-
* Shortened the output by removing Session from Session ID to increase line availability for messages
|
|
23
|
-
* Increased log level padding to 8 characters to ensure consistent spacing
|
|
24
|
-
* (this looks a bit weird, not sure if I like it but I also tried centered log levels and it no look good :( )
|
|
25
|
-
* Added many configuration options to the logger function (level, internal, console, file, filename, path, maxSize, maxFiles, timestamp)
|
|
26
|
-
* TODO: locations has a weird bug that carries location from instance to instance, ONLY, when another instanced is called
|
|
27
|
-
* from a different file. I have no idea why this is happening.
|
|
28
|
-
* i.e. app.js calls route.js then back to app.js but the location is still route.js. This does not happen when directly
|
|
29
|
-
* calling route.js.
|
|
30
|
-
* TODO: probably rewrite the whole thing to improve readability and maintainability
|
|
31
|
-
* TODO: cry
|
|
32
|
-
* TODO: timestamp, console, file, filename have not been tested nor implemented
|
|
33
|
-
* v2.1.0 - 03/17/2024:
|
|
34
|
-
* Modified custom log colors to use ANSI escape codes
|
|
35
|
-
* Changed the console formatter to paint the level and message with the corresponding color
|
|
36
|
-
* Modified the color generation formula. Now with prettier colors!
|
|
37
|
-
*
|
|
38
|
-
* v2.0.0 - 01/20/2024:
|
|
39
|
-
* Added bright color generation
|
|
40
|
-
* Added session ID generation
|
|
41
|
-
* Added separate console and file formatters
|
|
42
|
-
* Added rotating file transport with 5 files of 1MB each (5MB total)
|
|
43
|
-
*
|
|
44
|
-
* v1.0.0 - 10/18/2023:
|
|
45
|
-
* Initial release
|
|
46
12
|
*/
|
|
47
13
|
const winston = require('winston');
|
|
48
14
|
const crypto = require('crypto');
|