@ui5/logger 3.0.1-rc.1 → 3.0.1-rc.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/CHANGELOG.md +9 -1
- package/lib/index.js +39 -41
- package/lib/loggers/Logger.js +2 -2
- package/lib/writers/Console.js +7 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.3...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v3.0.1-rc.3"></a>
|
|
8
|
+
## [v3.0.1-rc.3] - 2023-02-02
|
|
9
|
+
|
|
10
|
+
<a name="v3.0.1-rc.2"></a>
|
|
11
|
+
## [v3.0.1-rc.2] - 2023-01-24
|
|
6
12
|
|
|
7
13
|
<a name="v3.0.1-rc.1"></a>
|
|
8
14
|
## [v3.0.1-rc.1] - 2023-01-18
|
|
@@ -143,6 +149,8 @@ Only Node.js v10 or higher is supported.
|
|
|
143
149
|
<a name="v0.0.1"></a>
|
|
144
150
|
## v0.0.1 - 2018-06-06
|
|
145
151
|
|
|
152
|
+
[v3.0.1-rc.3]: https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.2...v3.0.1-rc.3
|
|
153
|
+
[v3.0.1-rc.2]: https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.1...v3.0.1-rc.2
|
|
146
154
|
[v3.0.1-rc.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.0...v3.0.1-rc.1
|
|
147
155
|
[v3.0.1-rc.0]: https://github.com/SAP/ui5-logger/compare/v3.0.1-beta.1...v3.0.1-rc.0
|
|
148
156
|
[v3.0.1-beta.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-beta.0...v3.0.1-beta.1
|
package/lib/index.js
CHANGED
|
@@ -6,48 +6,46 @@ import Logger from "./loggers/Logger.js";
|
|
|
6
6
|
* @public
|
|
7
7
|
* @module @ui5/logger
|
|
8
8
|
*/
|
|
9
|
-
export default {
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Convenience function to create an instance of [@ui5/logger/Logger]{@link @ui5/logger/Logger}
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @param {string} moduleName Identifier for messages created by the logger.
|
|
15
|
+
* Example: <code>module:submodule:Class</code>
|
|
16
|
+
* @returns {@ui5/logger/Logger}
|
|
17
|
+
*/
|
|
18
|
+
export function getLogger(moduleName) {
|
|
19
|
+
return new Logger(moduleName);
|
|
20
|
+
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Tests whether the provided log level is enabled by the current log level
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
* @function
|
|
27
|
+
* @param {string} levelName Log level to test
|
|
28
|
+
* @returns {boolean} True if the provided level is enabled
|
|
29
|
+
*/
|
|
30
|
+
export const isLogLevelEnabled = Logger.isLevelEnabled;
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Sets the standard log level.
|
|
34
|
+
* <br>
|
|
35
|
+
* <b>Example:</b> Setting it to <code>perf</code> would suppress all <code>silly</code> and <code>verbose</code>
|
|
36
|
+
* logging, and only show <code>perf</code>, <code>info</code>, <code>warn</code> and <code>error</code> logs.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
* @function
|
|
40
|
+
* @param {string} levelName New log level
|
|
41
|
+
*/
|
|
42
|
+
export const setLogLevel = Logger.setLevel;
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
44
|
+
/**
|
|
45
|
+
* Gets the current log level
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
* @function
|
|
49
|
+
* @returns {string} The current log level. Defaults to <code>info</code>
|
|
50
|
+
*/
|
|
51
|
+
export const getLogLevel = Logger.getLevel;
|
package/lib/loggers/Logger.js
CHANGED
|
@@ -2,7 +2,7 @@ import process from "node:process";
|
|
|
2
2
|
import {inspect} from "node:util";
|
|
3
3
|
|
|
4
4
|
// Module name must not contain any other characters than alphanumerical and some specials
|
|
5
|
-
const rIllegalModuleNameChars = /[^0-9a-zA-Z-_
|
|
5
|
+
const rIllegalModuleNameChars = /[^0-9a-zA-Z-_:@./]/i;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Standard logging module for UI5 Tooling and extensions.
|
|
@@ -15,7 +15,7 @@ const rIllegalModuleNameChars = /[^0-9a-zA-Z-_:@.]/i;
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
* @class
|
|
18
|
-
* @alias @ui5/logger/
|
|
18
|
+
* @alias @ui5/logger/Logger
|
|
19
19
|
*/
|
|
20
20
|
class Logger {
|
|
21
21
|
/**
|
package/lib/writers/Console.js
CHANGED
|
@@ -28,6 +28,7 @@ class Console {
|
|
|
28
28
|
this._handleProjectBuildStatusEvent = this.#handleProjectBuildStatusEvent.bind(this);
|
|
29
29
|
this._handleBuildMetadataEvent = this.#handleBuildMetadataEvent.bind(this);
|
|
30
30
|
this._handleProjectBuildMetadataEvent = this.#handleProjectBuildMetadataEvent.bind(this);
|
|
31
|
+
this._handleStop = this.disable.bind(this);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -41,6 +42,7 @@ class Console {
|
|
|
41
42
|
process.on("ui5.project-build-metadata", this._handleProjectBuildMetadataEvent);
|
|
42
43
|
process.on("ui5.build-status", this._handleBuildStatusEvent);
|
|
43
44
|
process.on("ui5.project-build-status", this._handleProjectBuildStatusEvent);
|
|
45
|
+
process.on("ui5.log.stop-console", this._handleStop);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/**
|
|
@@ -54,6 +56,7 @@ class Console {
|
|
|
54
56
|
process.off("ui5.project-build-metadata", this._handleProjectBuildMetadataEvent);
|
|
55
57
|
process.off("ui5.build-status", this._handleBuildStatusEvent);
|
|
56
58
|
process.off("ui5.project-build-status", this._handleProjectBuildStatusEvent);
|
|
59
|
+
process.off("ui5.log.stop-console", this._handleStop);
|
|
57
60
|
if (this.#progressBarContainer) {
|
|
58
61
|
this.#progressBar.stop();
|
|
59
62
|
this.#progressBarContainer.stop(); // Will fire internal stop event
|
|
@@ -366,6 +369,10 @@ class Console {
|
|
|
366
369
|
cH.enable();
|
|
367
370
|
return cH;
|
|
368
371
|
}
|
|
372
|
+
|
|
373
|
+
static stop() {
|
|
374
|
+
process.emit("ui5.log.stop-console");
|
|
375
|
+
}
|
|
369
376
|
}
|
|
370
377
|
|
|
371
378
|
export default Console;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/logger",
|
|
3
|
-
"version": "3.0.1-rc.
|
|
3
|
+
"version": "3.0.1-rc.3",
|
|
4
4
|
"description": "UI5 Tooling - Internal Logger",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./lib/index.js",
|
|
22
|
-
"./
|
|
22
|
+
"./Logger": "./lib/loggers/Logger.js",
|
|
23
23
|
"./writers/*": "./lib/writers/*.js",
|
|
24
24
|
"./package.json": "./package.json",
|
|
25
25
|
"./internal/loggers/*": "./lib/loggers/*.js"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": "^16.18.0 || >=18.
|
|
28
|
+
"node": "^16.18.0 || >=18.12.0",
|
|
29
29
|
"npm": ">= 8"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
|
|
47
47
|
"postversion": "git push --follow-tags",
|
|
48
48
|
"release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
|
|
49
|
-
"depcheck": "depcheck --ignores @ui5/logger,docdash,@istanbuljs/esm-loader-hook"
|
|
49
|
+
"depcheck": "depcheck --ignores @ui5/logger,rimraf,docdash,@istanbuljs/esm-loader-hook"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"CHANGELOG.md",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"cross-env": "^7.0.3",
|
|
121
121
|
"depcheck": "^1.4.3",
|
|
122
122
|
"docdash": "^2.0.1",
|
|
123
|
-
"eslint": "^8.
|
|
123
|
+
"eslint": "^8.33.0",
|
|
124
124
|
"eslint-config-google": "^0.14.0",
|
|
125
|
-
"eslint-plugin-ava": "^
|
|
126
|
-
"eslint-plugin-jsdoc": "^39.
|
|
125
|
+
"eslint-plugin-ava": "^14.0.0",
|
|
126
|
+
"eslint-plugin-jsdoc": "^39.7.4",
|
|
127
127
|
"jsdoc": "^3.6.11",
|
|
128
128
|
"nyc": "^15.1.0",
|
|
129
129
|
"open-cli": "^7.1.0",
|
|
130
|
-
"rimraf": "^
|
|
130
|
+
"rimraf": "^4.1.2",
|
|
131
131
|
"sinon": "^15.0.1",
|
|
132
132
|
"strip-ansi": "^7.0.1",
|
|
133
133
|
"tap-xunit": "^2.4.1"
|