@springtree/eva-sdk-core-logger 1.2.3 → 2.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springtree/eva-sdk-core-logger",
3
- "version": "1.2.3",
3
+ "version": "2.0.0",
4
4
  "description": "The shared logging implementation for the EVA SDK",
5
5
  "keywords": [
6
6
  "eva",
@@ -10,8 +10,9 @@
10
10
  "author": "SpringTree <info@springtree.nl>",
11
11
  "homepage": "http://www.springtree.eu",
12
12
  "license": "ISC",
13
- "main": "lib/eva-sdk-core-logger.umd.js",
14
- "module": "lib/eva-sdk-core-logger.es5.js",
13
+ "main": "lib/eva-sdk-core-logger.js",
14
+ "module": "lib/eva-sdk-core-logger.js",
15
+ "type": "module",
15
16
  "typings": "lib/eva-sdk-core-logger.d.ts",
16
17
  "directories": {
17
18
  "lib": "lib",
@@ -30,5 +31,5 @@
30
31
  "lines-logger": "^2.1.2"
31
32
  },
32
33
  "private": false,
33
- "gitHead": "32562a612f9e417a4ae9228be6466677e268c405"
34
+ "gitHead": "e5a13ab2e6c139966aa0907cff56676c3b8753dd"
34
35
  }
package/CHANGELOG.md DELETED
@@ -1,201 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## 1.2.3 (2022-01-18)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **logger:** default log level set to debug ([bdc5cae](https://github.com/springtreesolutions/eva-sdk-repo/commit/bdc5caebd5579eb141498e08a210d6e899f64054))
12
-
13
-
14
-
15
-
16
-
17
- ## [1.2.2](https://github.com/springtreesolutions/eva-sdk-repo/compare/@springtree/eva-sdk-core-logger@1.2.1...@springtree/eva-sdk-core-logger@1.2.2) (2022-01-18)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * **logger:** update when log level changes ([9530eee](https://github.com/springtreesolutions/eva-sdk-repo/commit/9530eeec8328cdaba50b02c10746daf7c2f347ae))
23
-
24
-
25
-
26
-
27
-
28
- ## [1.2.1](https://github.com/springtreesolutions/eva-sdk-repo/compare/@springtree/eva-sdk-core-logger@1.2.0...@springtree/eva-sdk-core-logger@1.2.1) (2022-01-18)
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * **logger:** new logger needs an invocation ([7d6b85b](https://github.com/springtreesolutions/eva-sdk-repo/commit/7d6b85badc364e04e379f478f4f3297bb5a11bde))
34
-
35
-
36
-
37
-
38
-
39
- # 1.2.0 (2022-01-18)
40
-
41
-
42
- ### Features
43
-
44
- * **logger:** replace browser-bunyan with lines-logger ([504d98e](https://github.com/springtreesolutions/eva-sdk-repo/commit/504d98e1f9e616436c153f4d62ce740c1a6523ff))
45
-
46
-
47
-
48
-
49
-
50
- ## 1.1.3 (2022-01-17)
51
-
52
-
53
- ### Bug Fixes
54
-
55
- * **logger:** add own log levels ([789ae29](https://github.com/springtreesolutions/eva-sdk-repo/commit/789ae29e19518feaa099753ef30758f95cf8d65b))
56
-
57
-
58
-
59
-
60
-
61
- ## 1.1.2 (2021-07-12)
62
-
63
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
64
-
65
-
66
-
67
-
68
-
69
- ## 1.1.1 (2021-02-22)
70
-
71
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
72
-
73
-
74
-
75
-
76
-
77
- # 1.1.0 (2021-02-22)
78
-
79
-
80
- ### Features
81
-
82
- * **sdk-react:** add wish list state ([99d567f](https://github.com/springtreesolutions/eva-sdk-repo/commit/99d567f5af7b2bd8a1ea3e3a4bf8700ae0ef8d87))
83
-
84
-
85
-
86
-
87
-
88
- ## 1.0.11 (2021-02-22)
89
-
90
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
91
-
92
-
93
-
94
-
95
-
96
- ## 1.0.10 (2021-02-22)
97
-
98
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
99
-
100
-
101
-
102
-
103
-
104
- ## 1.0.9 (2021-02-19)
105
-
106
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
107
-
108
-
109
-
110
-
111
-
112
- ## 1.0.8 (2021-02-19)
113
-
114
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
115
-
116
-
117
-
118
-
119
-
120
- ## 1.0.7 (2021-02-19)
121
-
122
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
123
-
124
-
125
-
126
-
127
-
128
- ## 1.0.6 (2021-02-19)
129
-
130
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
131
-
132
-
133
-
134
-
135
-
136
- ## 1.0.5 (2021-02-19)
137
-
138
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
139
-
140
-
141
-
142
-
143
-
144
- ## 1.0.4 (2021-02-19)
145
-
146
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
147
-
148
-
149
-
150
-
151
-
152
- ## 1.0.3 (2020-11-10)
153
-
154
-
155
- ### Bug Fixes
156
-
157
- * **logger:** set log level helper ([fd65e1a](https://github.com/springtreesolutions/eva-sdk-repo/commit/fd65e1a89fcf21e18b3fb9b6a46539373ab33cbe))
158
-
159
-
160
-
161
-
162
-
163
- ## [1.0.2](https://github.com/springtreesolutions/eva-sdk-repo/compare/@springtree/eva-sdk-core-logger@1.0.1...@springtree/eva-sdk-core-logger@1.0.2) (2019-12-20)
164
-
165
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
166
-
167
-
168
-
169
-
170
-
171
- ## [1.0.1](https://github.com/springtreesolutions/eva-sdk-repo/compare/@springtree/eva-sdk-core-logger@1.0.0...@springtree/eva-sdk-core-logger@1.0.1) (2019-09-20)
172
-
173
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
174
-
175
-
176
-
177
-
178
-
179
- # 1.0.0 (2019-09-20)
180
-
181
-
182
- ### Bug Fixes
183
-
184
- * **logger:** export log level enum ([7ceb5ce](https://github.com/springtreesolutions/eva-sdk-repo/commit/7ceb5ce))
185
- * **logger:** reduce default log level ([1ade71d](https://github.com/springtreesolutions/eva-sdk-repo/commit/1ade71d))
186
- * **logger:** restore debug logging for tests ([77d5d9b](https://github.com/springtreesolutions/eva-sdk-repo/commit/77d5d9b))
187
- * **logger:** set default level to info ([d39a9fd](https://github.com/springtreesolutions/eva-sdk-repo/commit/d39a9fd))
188
- * **logger:** use raw stream for node ([14a6db5](https://github.com/springtreesolutions/eva-sdk-repo/commit/14a6db5))
189
- * **logging:** support test env ([d4356ac](https://github.com/springtreesolutions/eva-sdk-repo/commit/d4356ac))
190
- * **npm:** add homepage ([72cf0b4](https://github.com/springtreesolutions/eva-sdk-repo/commit/72cf0b4))
191
- * **npm:** added typings ([835ce37](https://github.com/springtreesolutions/eva-sdk-repo/commit/835ce37))
192
- * **npm:** made packages public ([62b68eb](https://github.com/springtreesolutions/eva-sdk-repo/commit/62b68eb))
193
- * **package.json:** setup author and license ([cbc3c1b](https://github.com/springtreesolutions/eva-sdk-repo/commit/cbc3c1b))
194
- * **repo:** update to latest and apply coding style ([a2538a1](https://github.com/springtreesolutions/eva-sdk-repo/commit/a2538a1))
195
-
196
-
197
- ### Features
198
-
199
- * **core-logger:** added base logger ([f95f14d](https://github.com/springtreesolutions/eva-sdk-repo/commit/f95f14d))
200
- * **logger:** switched to browser-bunyan ([49b0121](https://github.com/springtreesolutions/eva-sdk-repo/commit/49b0121))
201
- * **rollup:** added bundle support ([c2647ca](https://github.com/springtreesolutions/eva-sdk-repo/commit/c2647ca))
@@ -1,29 +0,0 @@
1
- function unwrapExports (x) {
2
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3
- }
4
-
5
- function createCommonjsModule(fn, module) {
6
- return module = { exports: {} }, fn(module, module.exports), module.exports;
7
- }
8
-
9
- var lib = createCommonjsModule(function (module, exports) {
10
- exports.__esModule=!0,exports.LoggerFactory=exports.logLevels=void 0,exports.logLevels={log_raise_error:1,log_with_warnings:2,trace:3,debug:4,info:5,warn:6,error:7,disable:8};var LoggerFactory=function(){function LoggerFactory(logLevel,mockConsole){if(void 0===logLevel&&(logLevel="log_with_warnings"),void 0===mockConsole&&(mockConsole=null),this.logLevel=logLevel,!exports.logLevels[logLevel])throw Error("Invalid log level "+logLevel+" allowed: "+JSON.stringify(exports.logLevels));this.mockConsole=mockConsole||console;}return LoggerFactory.prototype.dummy=function(){},LoggerFactory.prototype.setLogWarnings=function(logWarnings){this.logLevel=logWarnings;},LoggerFactory.prototype.getLogWarnings=function(){return this.logLevel},LoggerFactory.prototype.getSingleLoggerColor=function(name,color,fn){return this.getSingleLoggerStyle(name,this.getColorStyle(color),fn)},LoggerFactory.prototype.getSingleLogger=function(name,fn){var color=this.getRandomColor(name);return this.getSingleLoggerStyle(name,this.getColorStyle(color),fn)},LoggerFactory.prototype.getSingleLoggerStyle=function(name,style,fn,minLevel){var _this=this;return void 0===minLevel&&(minLevel="log_with_warnings"),function(){for(var args1=[],_i=0;_i<arguments.length;_i++)args1[_i]=arguments[_i];if(exports.logLevels[_this.logLevel]>exports.logLevels[minLevel])return _this.dummy;for(var args=Array.prototype.slice.call(args1),parts=args.shift().split("{}"),params=[_this.mockConsole,"%c"+name,style],i=0;i<parts.length;i++)params.push(parts[i]),void 0!==args[i]&&params.push(args[i]);if(parts.length-1!==args.length)if("log_with_warnings"===_this.logLevel)_this.mockConsole.error("MissMatch amount of arguments");else if("log_raise_error"===_this.logLevel)throw new Error("MissMatch amount of arguments");return Function.prototype.bind.apply(fn,params)}},LoggerFactory.prototype.getLoggerColor=function(name,color){return this.getLoggerStyle(name,this.getColorStyle(color))},LoggerFactory.prototype.getColorStyle=function(color){return "color: white; background-color: "+color+"; padding: 2px 6px; border-radius: 2px; font-size: 10px"},LoggerFactory.getHash=function(str,seed){void 0===seed&&(seed=0);for(var h1=3735928559^seed,h2=1103547991^seed,i=0,ch=void 0;i<str.length;i++)ch=str.charCodeAt(i),h1=Math.imul(h1^ch,2654435761),h2=Math.imul(h2^ch,1597334677);return h1=Math.imul(h1^h1>>>16,2246822507)^Math.imul(h2^h2>>>13,3266489909),4294967296*(2097151&(h2=Math.imul(h2^h2>>>16,2246822507)^Math.imul(h1^h1>>>13,3266489909)))+(h1>>>0)},LoggerFactory.prototype.getRandomColor=function(str){void 0===str&&(str="");for(var hash=LoggerFactory.getHash(str),color="#",i=0;i<3;i++)color+=("00"+(8+(hash>>7*i&127)).toString(16)).substr(-2);return color},LoggerFactory.prototype.getLogger=function(name){return this.getLoggerColor(name,this.getRandomColor(name))},LoggerFactory.prototype.getLoggerStyle=function(name,style){return {trace:this.getSingleLoggerStyle(name,style,this.mockConsole.trace,"trace"),debug:this.getSingleLoggerStyle(name,style,this.mockConsole.debug,"debug"),log:this.getSingleLoggerStyle(name,style,this.mockConsole.log,"info"),warn:this.getSingleLoggerStyle(name,style,this.mockConsole.warn,"warn"),error:this.getSingleLoggerStyle(name,style,this.mockConsole.error,"error")}},LoggerFactory}();exports.LoggerFactory=LoggerFactory;
11
- });
12
-
13
- unwrapExports(lib);
14
- var lib_1 = lib.LoggerFactory;
15
- lib.logLevels;
16
-
17
- const factory = new lib_1();
18
- factory.setLogWarnings('debug');
19
- let logger = factory.getLogger('EVA-SDK');
20
- const setLogLevel = (level) => {
21
- factory.setLogWarnings(level);
22
- logger = factory.getLogger('EVA-SDK');
23
- };
24
- const createLogger = (context) => {
25
- return factory.getLogger(context);
26
- };
27
-
28
- export { createLogger, factory, logger, setLogLevel };
29
- //# sourceMappingURL=eva-sdk-core-logger.es5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eva-sdk-core-logger.es5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,41 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.evaSdkCoreLogger = {}));
5
- })(this, (function (exports) { 'use strict';
6
-
7
- function unwrapExports (x) {
8
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
- }
10
-
11
- function createCommonjsModule(fn, module) {
12
- return module = { exports: {} }, fn(module, module.exports), module.exports;
13
- }
14
-
15
- var lib = createCommonjsModule(function (module, exports) {
16
- exports.__esModule=!0,exports.LoggerFactory=exports.logLevels=void 0,exports.logLevels={log_raise_error:1,log_with_warnings:2,trace:3,debug:4,info:5,warn:6,error:7,disable:8};var LoggerFactory=function(){function LoggerFactory(logLevel,mockConsole){if(void 0===logLevel&&(logLevel="log_with_warnings"),void 0===mockConsole&&(mockConsole=null),this.logLevel=logLevel,!exports.logLevels[logLevel])throw Error("Invalid log level "+logLevel+" allowed: "+JSON.stringify(exports.logLevels));this.mockConsole=mockConsole||console;}return LoggerFactory.prototype.dummy=function(){},LoggerFactory.prototype.setLogWarnings=function(logWarnings){this.logLevel=logWarnings;},LoggerFactory.prototype.getLogWarnings=function(){return this.logLevel},LoggerFactory.prototype.getSingleLoggerColor=function(name,color,fn){return this.getSingleLoggerStyle(name,this.getColorStyle(color),fn)},LoggerFactory.prototype.getSingleLogger=function(name,fn){var color=this.getRandomColor(name);return this.getSingleLoggerStyle(name,this.getColorStyle(color),fn)},LoggerFactory.prototype.getSingleLoggerStyle=function(name,style,fn,minLevel){var _this=this;return void 0===minLevel&&(minLevel="log_with_warnings"),function(){for(var args1=[],_i=0;_i<arguments.length;_i++)args1[_i]=arguments[_i];if(exports.logLevels[_this.logLevel]>exports.logLevels[minLevel])return _this.dummy;for(var args=Array.prototype.slice.call(args1),parts=args.shift().split("{}"),params=[_this.mockConsole,"%c"+name,style],i=0;i<parts.length;i++)params.push(parts[i]),void 0!==args[i]&&params.push(args[i]);if(parts.length-1!==args.length)if("log_with_warnings"===_this.logLevel)_this.mockConsole.error("MissMatch amount of arguments");else if("log_raise_error"===_this.logLevel)throw new Error("MissMatch amount of arguments");return Function.prototype.bind.apply(fn,params)}},LoggerFactory.prototype.getLoggerColor=function(name,color){return this.getLoggerStyle(name,this.getColorStyle(color))},LoggerFactory.prototype.getColorStyle=function(color){return "color: white; background-color: "+color+"; padding: 2px 6px; border-radius: 2px; font-size: 10px"},LoggerFactory.getHash=function(str,seed){void 0===seed&&(seed=0);for(var h1=3735928559^seed,h2=1103547991^seed,i=0,ch=void 0;i<str.length;i++)ch=str.charCodeAt(i),h1=Math.imul(h1^ch,2654435761),h2=Math.imul(h2^ch,1597334677);return h1=Math.imul(h1^h1>>>16,2246822507)^Math.imul(h2^h2>>>13,3266489909),4294967296*(2097151&(h2=Math.imul(h2^h2>>>16,2246822507)^Math.imul(h1^h1>>>13,3266489909)))+(h1>>>0)},LoggerFactory.prototype.getRandomColor=function(str){void 0===str&&(str="");for(var hash=LoggerFactory.getHash(str),color="#",i=0;i<3;i++)color+=("00"+(8+(hash>>7*i&127)).toString(16)).substr(-2);return color},LoggerFactory.prototype.getLogger=function(name){return this.getLoggerColor(name,this.getRandomColor(name))},LoggerFactory.prototype.getLoggerStyle=function(name,style){return {trace:this.getSingleLoggerStyle(name,style,this.mockConsole.trace,"trace"),debug:this.getSingleLoggerStyle(name,style,this.mockConsole.debug,"debug"),log:this.getSingleLoggerStyle(name,style,this.mockConsole.log,"info"),warn:this.getSingleLoggerStyle(name,style,this.mockConsole.warn,"warn"),error:this.getSingleLoggerStyle(name,style,this.mockConsole.error,"error")}},LoggerFactory}();exports.LoggerFactory=LoggerFactory;
17
- });
18
-
19
- unwrapExports(lib);
20
- var lib_1 = lib.LoggerFactory;
21
- lib.logLevels;
22
-
23
- const factory = new lib_1();
24
- factory.setLogWarnings('debug');
25
- exports.logger = factory.getLogger('EVA-SDK');
26
- const setLogLevel = (level) => {
27
- factory.setLogWarnings(level);
28
- exports.logger = factory.getLogger('EVA-SDK');
29
- };
30
- const createLogger = (context) => {
31
- return factory.getLogger(context);
32
- };
33
-
34
- exports.createLogger = createLogger;
35
- exports.factory = factory;
36
- exports.setLogLevel = setLogLevel;
37
-
38
- Object.defineProperty(exports, '__esModule', { value: true });
39
-
40
- }));
41
- //# sourceMappingURL=eva-sdk-core-logger.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eva-sdk-core-logger.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}