@ui5/logger 3.0.1-rc.1 → 3.0.1-rc.2
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 +5 -1
- package/lib/index.js +39 -41
- package/lib/loggers/Logger.js +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
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.2...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v3.0.1-rc.2"></a>
|
|
8
|
+
## [v3.0.1-rc.2] - 2023-01-24
|
|
6
9
|
|
|
7
10
|
<a name="v3.0.1-rc.1"></a>
|
|
8
11
|
## [v3.0.1-rc.1] - 2023-01-18
|
|
@@ -143,6 +146,7 @@ Only Node.js v10 or higher is supported.
|
|
|
143
146
|
<a name="v0.0.1"></a>
|
|
144
147
|
## v0.0.1 - 2018-06-06
|
|
145
148
|
|
|
149
|
+
[v3.0.1-rc.2]: https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.1...v3.0.1-rc.2
|
|
146
150
|
[v3.0.1-rc.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-rc.0...v3.0.1-rc.1
|
|
147
151
|
[v3.0.1-rc.0]: https://github.com/SAP/ui5-logger/compare/v3.0.1-beta.1...v3.0.1-rc.0
|
|
148
152
|
[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/loggers/Logger]{@link @ui5/logger/loggers/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/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.2",
|
|
4
4
|
"description": "UI5 Tooling - Internal Logger",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -19,7 +19,7 @@
|
|
|
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"
|
|
@@ -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",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"docdash": "^2.0.1",
|
|
123
123
|
"eslint": "^8.32.0",
|
|
124
124
|
"eslint-config-google": "^0.14.0",
|
|
125
|
-
"eslint-plugin-ava": "^
|
|
126
|
-
"eslint-plugin-jsdoc": "^39.6.
|
|
125
|
+
"eslint-plugin-ava": "^14.0.0",
|
|
126
|
+
"eslint-plugin-jsdoc": "^39.6.7",
|
|
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.1",
|
|
131
131
|
"sinon": "^15.0.1",
|
|
132
132
|
"strip-ansi": "^7.0.1",
|
|
133
133
|
"tap-xunit": "^2.4.1"
|