metalog 3.1.8 → 3.1.11
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/LICENSE +1 -1
- package/README.md +1 -1
- package/metalog.d.ts +1 -1
- package/metalog.js +7 -7
- package/package.json +12 -15
- package/CHANGELOG.md +0 -83
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -31,6 +31,6 @@ await logger.close();
|
|
|
31
31
|
|
|
32
32
|
## License & Contributors
|
|
33
33
|
|
|
34
|
-
Copyright (c) 2017-
|
|
34
|
+
Copyright (c) 2017-2023 [Metarhia contributors](https://github.com/metarhia/metalog/graphs/contributors).
|
|
35
35
|
Metalog is [MIT licensed](./LICENSE).\
|
|
36
36
|
Metalog is a part of [Metarhia](https://github.com/metarhia) technology stack.
|
package/metalog.d.ts
CHANGED
package/metalog.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
3
|
+
const fs = require('node:fs');
|
|
4
4
|
const fsp = fs.promises;
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const util = require('util');
|
|
7
|
-
const events = require('events');
|
|
8
|
-
const readline = require('readline');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const util = require('node:util');
|
|
7
|
+
const events = require('node:events');
|
|
8
|
+
const readline = require('node:readline');
|
|
9
9
|
const metautil = require('metautil');
|
|
10
10
|
const concolor = require('concolor');
|
|
11
11
|
|
|
@@ -188,7 +188,7 @@ class Logger extends events.EventEmitter {
|
|
|
188
188
|
super();
|
|
189
189
|
const { workerId = 0, createStream = fs.createWriteStream } = args;
|
|
190
190
|
const { writeInterval, writeBuffer, keepDays, home, json } = args;
|
|
191
|
-
const { toFile, toStdout } = args;
|
|
191
|
+
const { toFile = [], toStdout = [] } = args;
|
|
192
192
|
this.active = false;
|
|
193
193
|
this.path = args.path;
|
|
194
194
|
this.workerId = `W${workerId}`;
|
|
@@ -205,7 +205,7 @@ class Logger extends events.EventEmitter {
|
|
|
205
205
|
this.buffer = [];
|
|
206
206
|
this.file = '';
|
|
207
207
|
this.toFile = logTypes(toFile);
|
|
208
|
-
this.fsEnabled =
|
|
208
|
+
this.fsEnabled = toFile.length !== 0;
|
|
209
209
|
this.toStdout = logTypes(toStdout);
|
|
210
210
|
this.console = new Console((...args) => this.write(...args));
|
|
211
211
|
return this.open();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metalog",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",
|
|
5
5
|
"description": "Logger for Metarhia",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,10 +38,7 @@
|
|
|
38
38
|
"main": "metalog.js",
|
|
39
39
|
"types": "metalog.d.ts",
|
|
40
40
|
"readmeFilename": "README.md",
|
|
41
|
-
"files": [
|
|
42
|
-
"types/",
|
|
43
|
-
"metalog.d.ts"
|
|
44
|
-
],
|
|
41
|
+
"files": ["types/", "metalog.d.ts"],
|
|
45
42
|
"scripts": {
|
|
46
43
|
"test": "npm run lint && npm run types && metatests test/",
|
|
47
44
|
"types": "tsc -p tsconfig.json",
|
|
@@ -49,21 +46,21 @@
|
|
|
49
46
|
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \"**/.*rc\" \"**/*.ts\""
|
|
50
47
|
},
|
|
51
48
|
"engines": {
|
|
52
|
-
"node": "
|
|
49
|
+
"node": "16 || 18 || 19 || 20"
|
|
53
50
|
},
|
|
54
51
|
"dependencies": {
|
|
55
|
-
"concolor": "^1.0.
|
|
56
|
-
"metautil": "^3.
|
|
52
|
+
"concolor": "^1.0.6",
|
|
53
|
+
"metautil": "^3.7.2"
|
|
57
54
|
},
|
|
58
55
|
"devDependencies": {
|
|
59
|
-
"@types/node": "^
|
|
60
|
-
"eslint": "^8.
|
|
61
|
-
"eslint-config-metarhia": "^
|
|
62
|
-
"eslint-config-prettier": "^8.
|
|
63
|
-
"eslint-plugin-import": "^2.
|
|
56
|
+
"@types/node": "^18.16.1",
|
|
57
|
+
"eslint": "^8.36.0",
|
|
58
|
+
"eslint-config-metarhia": "^8.1.0",
|
|
59
|
+
"eslint-config-prettier": "^8.7.0",
|
|
60
|
+
"eslint-plugin-import": "^2.27.5",
|
|
64
61
|
"eslint-plugin-prettier": "^4.0.0",
|
|
65
62
|
"metatests": "^0.8.2",
|
|
66
|
-
"prettier": "^2.
|
|
67
|
-
"typescript": "^
|
|
63
|
+
"prettier": "^2.8.4",
|
|
64
|
+
"typescript": "^5.0.4"
|
|
68
65
|
}
|
|
69
66
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [Unreleased][unreleased]
|
|
4
|
-
|
|
5
|
-
## [3.1.8][] - 2022-03-30
|
|
6
|
-
|
|
7
|
-
- Add support for json-only logs
|
|
8
|
-
|
|
9
|
-
## [3.1.7][] - 2022-03-17
|
|
10
|
-
|
|
11
|
-
- Fix unlink empty files
|
|
12
|
-
- Improve error handling
|
|
13
|
-
- Update dependencies and package maintenance
|
|
14
|
-
|
|
15
|
-
## [3.1.6][] - 2021-12-08
|
|
16
|
-
|
|
17
|
-
- Fix typings
|
|
18
|
-
- Remove useless code from tests
|
|
19
|
-
- Fix unlink file bug
|
|
20
|
-
|
|
21
|
-
## [3.1.5][] - 2021-10-11
|
|
22
|
-
|
|
23
|
-
- Update dependencies and npm audit fix
|
|
24
|
-
|
|
25
|
-
## [3.1.4][] - 2021-09-10
|
|
26
|
-
|
|
27
|
-
- Update dependencies
|
|
28
|
-
|
|
29
|
-
## [3.1.3][] - 2021-07-22
|
|
30
|
-
|
|
31
|
-
- Improve code style
|
|
32
|
-
- Move types to package root
|
|
33
|
-
|
|
34
|
-
## [3.1.2][] - 2021-05-24
|
|
35
|
-
|
|
36
|
-
- Package maintenance
|
|
37
|
-
|
|
38
|
-
## [3.1.1][] - 2021-01-15
|
|
39
|
-
|
|
40
|
-
- Remove code duplication: use metautil.replace
|
|
41
|
-
- Remove unneeded code and comments
|
|
42
|
-
- Add examples to README.md
|
|
43
|
-
- Add .d.ts typings
|
|
44
|
-
|
|
45
|
-
## [3.1.0][] - 2021-01-07
|
|
46
|
-
|
|
47
|
-
- Use metautil instead of metarhia/common
|
|
48
|
-
- Use writable factory instead of constructor
|
|
49
|
-
- Use fs.createWriteStream instead of metastreams
|
|
50
|
-
|
|
51
|
-
## [3.0.0][] - 2020-12-16
|
|
52
|
-
|
|
53
|
-
- Change Logger interface, use async/await
|
|
54
|
-
- Console interface implementation
|
|
55
|
-
- Create log folder if not exists
|
|
56
|
-
- Support windows
|
|
57
|
-
|
|
58
|
-
## [2.x][]
|
|
59
|
-
|
|
60
|
-
- New Logger class extends EventEmitter
|
|
61
|
-
- Refactor module to use new ES2020 syntax and features
|
|
62
|
-
- Rewrite code using async/await
|
|
63
|
-
- Truncate paths in stack traces to minimize log files
|
|
64
|
-
- Use metarhia eslint config
|
|
65
|
-
- Fix multiple bugs and optimize performance
|
|
66
|
-
|
|
67
|
-
## [1.x][]
|
|
68
|
-
|
|
69
|
-
First generation of Metarhia Logger
|
|
70
|
-
|
|
71
|
-
[unreleased]: https://github.com/metarhia/metalog/compare/v3.1.8...HEAD
|
|
72
|
-
[3.1.8]: https://github.com/metarhia/metalog/compare/v3.1.7...v3.1.8
|
|
73
|
-
[3.1.7]: https://github.com/metarhia/metalog/compare/v3.1.6...v3.1.7
|
|
74
|
-
[3.1.6]: https://github.com/metarhia/metalog/compare/v3.1.5...v3.1.6
|
|
75
|
-
[3.1.5]: https://github.com/metarhia/metalog/compare/v3.1.4...v3.1.5
|
|
76
|
-
[3.1.4]: https://github.com/metarhia/metalog/compare/v3.1.3...v3.1.4
|
|
77
|
-
[3.1.3]: https://github.com/metarhia/metalog/compare/v3.1.2...v3.1.3
|
|
78
|
-
[3.1.2]: https://github.com/metarhia/metalog/compare/v3.1.1...v3.1.2
|
|
79
|
-
[3.1.1]: https://github.com/metarhia/metalog/compare/v3.1.0...v3.1.1
|
|
80
|
-
[3.1.0]: https://github.com/metarhia/metalog/compare/v3.0.0...v3.1.0
|
|
81
|
-
[3.0.0]: https://github.com/metarhia/metalog/compare/v2.x...v3.0.0
|
|
82
|
-
[2.x]: https://github.com/metarhia/metalog/compare/v1.x...v2.x
|
|
83
|
-
[1.x]: https://github.com/metarhia/metalog/tree/v1.x
|