metalog 3.1.9 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2022 Metarhia
3
+ Copyright (c) 2017-2023 Metarhia
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -31,6 +31,6 @@ await logger.close();
31
31
 
32
32
  ## License & Contributors
33
33
 
34
- Copyright (c) 2017-2022 [Metarhia contributors](https://github.com/metarhia/metalog/graphs/contributors).
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
@@ -1,4 +1,4 @@
1
- import EventEmitter = require('events');
1
+ import EventEmitter = require('node:events');
2
2
 
3
3
  interface LoggerOptions {
4
4
  path: string;
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 = Object.keys(this.toFile).length !== 0;
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.9",
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": "14 || 16 || 18"
49
+ "node": "16 || 18 || 19 || 20"
53
50
  },
54
51
  "dependencies": {
55
- "concolor": "^1.0.3",
56
- "metautil": "^3.5.21"
52
+ "concolor": "^1.0.6",
53
+ "metautil": "^3.7.2"
57
54
  },
58
55
  "devDependencies": {
59
- "@types/node": "^18.0.3",
60
- "eslint": "^8.19.0",
56
+ "@types/node": "^18.16.1",
57
+ "eslint": "^8.36.0",
61
58
  "eslint-config-metarhia": "^8.1.0",
62
- "eslint-config-prettier": "^8.5.0",
63
- "eslint-plugin-import": "^2.25.4",
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.6.0",
67
- "typescript": "^4.6.2"
63
+ "prettier": "^2.8.4",
64
+ "typescript": "^5.0.4"
68
65
  }
69
66
  }
package/CHANGELOG.md DELETED
@@ -1,88 +0,0 @@
1
- # Changelog
2
-
3
- ## [Unreleased][unreleased]
4
-
5
- ## [3.1.9][] - 2022-07-07
6
-
7
- - Package maintenance
8
-
9
- ## [3.1.8][] - 2022-03-30
10
-
11
- - Add support for json-only logs
12
-
13
- ## [3.1.7][] - 2022-03-17
14
-
15
- - Fix unlink empty files
16
- - Improve error handling
17
- - Update dependencies and package maintenance
18
-
19
- ## [3.1.6][] - 2021-12-08
20
-
21
- - Fix typings
22
- - Remove useless code from tests
23
- - Fix unlink file bug
24
-
25
- ## [3.1.5][] - 2021-10-11
26
-
27
- - Update dependencies and npm audit fix
28
-
29
- ## [3.1.4][] - 2021-09-10
30
-
31
- - Update dependencies
32
-
33
- ## [3.1.3][] - 2021-07-22
34
-
35
- - Improve code style
36
- - Move types to package root
37
-
38
- ## [3.1.2][] - 2021-05-24
39
-
40
- - Package maintenance
41
-
42
- ## [3.1.1][] - 2021-01-15
43
-
44
- - Remove code duplication: use metautil.replace
45
- - Remove unneeded code and comments
46
- - Add examples to README.md
47
- - Add .d.ts typings
48
-
49
- ## [3.1.0][] - 2021-01-07
50
-
51
- - Use metautil instead of metarhia/common
52
- - Use writable factory instead of constructor
53
- - Use fs.createWriteStream instead of metastreams
54
-
55
- ## [3.0.0][] - 2020-12-16
56
-
57
- - Change Logger interface, use async/await
58
- - Console interface implementation
59
- - Create log folder if not exists
60
- - Support windows
61
-
62
- ## [2.x][]
63
-
64
- - New Logger class extends EventEmitter
65
- - Refactor module to use new ES2020 syntax and features
66
- - Rewrite code using async/await
67
- - Truncate paths in stack traces to minimize log files
68
- - Use metarhia eslint config
69
- - Fix multiple bugs and optimize performance
70
-
71
- ## [1.x][]
72
-
73
- First generation of Metarhia Logger
74
-
75
- [unreleased]: https://github.com/metarhia/metalog/compare/v3.1.9...HEAD
76
- [3.1.9]: https://github.com/metarhia/metalog/compare/v3.1.8...v3.1.9
77
- [3.1.8]: https://github.com/metarhia/metalog/compare/v3.1.7...v3.1.8
78
- [3.1.7]: https://github.com/metarhia/metalog/compare/v3.1.6...v3.1.7
79
- [3.1.6]: https://github.com/metarhia/metalog/compare/v3.1.5...v3.1.6
80
- [3.1.5]: https://github.com/metarhia/metalog/compare/v3.1.4...v3.1.5
81
- [3.1.4]: https://github.com/metarhia/metalog/compare/v3.1.3...v3.1.4
82
- [3.1.3]: https://github.com/metarhia/metalog/compare/v3.1.2...v3.1.3
83
- [3.1.2]: https://github.com/metarhia/metalog/compare/v3.1.1...v3.1.2
84
- [3.1.1]: https://github.com/metarhia/metalog/compare/v3.1.0...v3.1.1
85
- [3.1.0]: https://github.com/metarhia/metalog/compare/v3.0.0...v3.1.0
86
- [3.0.0]: https://github.com/metarhia/metalog/compare/v2.x...v3.0.0
87
- [2.x]: https://github.com/metarhia/metalog/compare/v1.x...v2.x
88
- [1.x]: https://github.com/metarhia/metalog/tree/v1.x