@ui5/logger 3.0.1-alpha.1 → 3.0.1-alpha.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 ADDED
@@ -0,0 +1,93 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
+
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.2...HEAD).
6
+
7
+ <a name="v3.0.1-alpha.2"></a>
8
+ ## [v3.0.1-alpha.2] - 2022-07-28
9
+ ### Features
10
+ - Add new log level "perf" [`acf0c71`](https://github.com/SAP/ui5-logger/commit/acf0c717612f440ea7a114e757c05d358ae523a7)
11
+
12
+
13
+ <a name="v3.0.1-alpha.1"></a>
14
+ ## [v3.0.1-alpha.1] - 2022-01-25
15
+ ### Breaking Changes
16
+ - Require Node.js >= 16.13.2 / npm >= 8 [`a8af8a7`](https://github.com/SAP/ui5-logger/commit/a8af8a7a82c6f657ac10b5018e654939d90fd81f)
17
+
18
+ ### BREAKING CHANGE
19
+
20
+ Support for older Node.js and npm releases has been dropped.
21
+ Only Node.js v16.13.2 and npm v8 or higher are supported.
22
+
23
+
24
+ <a name="v3.0.1-alpha.0"></a>
25
+ ## [v3.0.1-alpha.0] - 2021-12-14
26
+
27
+ <a name="v3.0.0-next.0"></a>
28
+ ## [v3.0.0-next.0] - 2021-11-29
29
+
30
+ <a name="v3.0.0-alpha.0"></a>
31
+ ## [v3.0.0-alpha.0] - 2021-12-14
32
+
33
+ <a name="v2.0.1"></a>
34
+ ## [v2.0.1] - 2020-10-22
35
+ ### Bug Fixes
36
+ - Typos in error messages [`1d25902`](https://github.com/SAP/ui5-logger/commit/1d2590223c4332f5ea6f1326b23ecf584fea5934)
37
+
38
+
39
+ <a name="v2.0.0"></a>
40
+ ## [v2.0.0] - 2020-03-31
41
+ ### Breaking Changes
42
+ - Require Node.js >= 10 [`1825d10`](https://github.com/SAP/ui5-logger/commit/1825d1013a88f164cbbfbf579c3e8e02df2b5082)
43
+
44
+ ### BREAKING CHANGE
45
+
46
+ Support for older Node.js releases has been dropped.
47
+ Only Node.js v10 or higher is supported.
48
+
49
+
50
+ <a name="v1.0.2"></a>
51
+ ## [v1.0.2] - 2019-10-14
52
+ ### Bug Fixes
53
+ - Fix handling of log level "silent" [`020ced8`](https://github.com/SAP/ui5-logger/commit/020ced85a82d33c94e429aa28983affa0d8341ba)
54
+
55
+
56
+ <a name="v1.0.1"></a>
57
+ ## [v1.0.1] - 2019-03-21
58
+
59
+ <a name="v1.0.0"></a>
60
+ ## [v1.0.0] - 2019-01-09
61
+
62
+ <a name="v0.2.2"></a>
63
+ ## [v0.2.2] - 2018-11-16
64
+ ### Features
65
+ - Add UI5_LOG_LVL environment variable [`c3e65c4`](https://github.com/SAP/ui5-logger/commit/c3e65c444045832773e4dc43ffa2baf903a27e52)
66
+
67
+
68
+ <a name="v0.2.1"></a>
69
+ ## [v0.2.1] - 2018-10-29
70
+
71
+ <a name="v0.2.0"></a>
72
+ ## [v0.2.0] - 2018-07-11
73
+
74
+ <a name="v0.1.0"></a>
75
+ ## [v0.1.0] - 2018-06-26
76
+
77
+ <a name="v0.0.1"></a>
78
+ ## v0.0.1 - 2018-06-06
79
+
80
+ [v3.0.1-alpha.2]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.1...v3.0.1-alpha.2
81
+ [v3.0.1-alpha.1]: https://github.com/SAP/ui5-logger/compare/v3.0.1-alpha.0...v3.0.1-alpha.1
82
+ [v3.0.1-alpha.0]: https://github.com/SAP/ui5-logger/compare/v3.0.0-next.0...v3.0.1-alpha.0
83
+ [v3.0.0-next.0]: https://github.com/SAP/ui5-logger/compare/v3.0.0-alpha.0...v3.0.0-next.0
84
+ [v3.0.0-alpha.0]: https://github.com/SAP/ui5-logger/compare/v2.0.1...v3.0.0-alpha.0
85
+ [v2.0.1]: https://github.com/SAP/ui5-logger/compare/v2.0.0...v2.0.1
86
+ [v2.0.0]: https://github.com/SAP/ui5-logger/compare/v1.0.2...v2.0.0
87
+ [v1.0.2]: https://github.com/SAP/ui5-logger/compare/v1.0.1...v1.0.2
88
+ [v1.0.1]: https://github.com/SAP/ui5-logger/compare/v1.0.0...v1.0.1
89
+ [v1.0.0]: https://github.com/SAP/ui5-logger/compare/v0.2.2...v1.0.0
90
+ [v0.2.2]: https://github.com/SAP/ui5-logger/compare/v0.2.1...v0.2.2
91
+ [v0.2.1]: https://github.com/SAP/ui5-logger/compare/v0.2.0...v0.2.1
92
+ [v0.2.0]: https://github.com/SAP/ui5-logger/compare/v0.1.0...v0.2.0
93
+ [v0.1.0]: https://github.com/SAP/ui5-logger/compare/v0.0.1...v0.1.0
package/lib/logger.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const npmlog = require("npmlog");
2
2
 
3
- const levels = ["silly", "verbose", "info", "warn", "error", "silent"];
3
+ const levels = ["silly", "verbose", "perf", "info", "warn", "error", "silent"];
4
4
  if (process.env.UI5_LOG_LVL) {
5
5
  const logLvl = process.env.UI5_LOG_LVL;
6
6
  if (!levels.includes(logLvl)) {
@@ -12,7 +12,12 @@ if (process.env.UI5_LOG_LVL) {
12
12
  npmlog.level = "info"; // Our default
13
13
  }
14
14
 
15
- npmlog.enableUnicode();
15
+ npmlog.enableUnicode(); // TODO: Check whether unicode is actually supported
16
+ npmlog.prefixStyle = {fg: "blue"};
17
+ npmlog.headingStyle = {fg: "white", bg: "black"};
18
+
19
+ // Verbose is at level 1000, info at 2000
20
+ npmlog.addLevel("perf", 1500, {fg: "white", bg: "red"}, "PERF");
16
21
 
17
22
  npmlog.on("error", (err) => {
18
23
  console.log(err);
@@ -52,6 +57,10 @@ class Logger {
52
57
  return this._logger.verbose(this._moduleName, ...messages);
53
58
  }
54
59
 
60
+ perf(...messages) {
61
+ return this._logger.perf(this._moduleName, ...messages);
62
+ }
63
+
55
64
  info(...messages) {
56
65
  return this._logger.info(this._moduleName, ...messages);
57
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/logger",
3
- "version": "3.0.1-alpha.1",
3
+ "version": "3.0.1-alpha.2",
4
4
  "description": "UI5 Tooling - Internal Logger",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -37,13 +37,14 @@
37
37
  "jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
38
38
  "jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
39
39
  "preversion": "npm test",
40
- "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
40
+ "version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
41
41
  "postversion": "git push --follow-tags",
42
- "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
42
+ "release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
43
43
  "depcheck": "depcheck --ignores docdash"
44
44
  },
45
45
  "files": [
46
46
  "index.js",
47
+ "CHANGELOG.md",
47
48
  "CONTRIBUTING.md",
48
49
  "jsdoc.json",
49
50
  "lib/**",
@@ -100,7 +101,7 @@
100
101
  "url": "git@github.com:SAP/ui5-logger.git"
101
102
  },
102
103
  "dependencies": {
103
- "npmlog": "^5.0.1"
104
+ "npmlog": "^6.0.2"
104
105
  },
105
106
  "devDependencies": {
106
107
  "ava": "^3.15.0",