@springtree/eva-sdk-core-logger 1.2.2 → 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.
@@ -1,6 +1,6 @@
1
1
  import { LoggerFactory } from 'lines-logger';
2
2
  export const factory = new LoggerFactory();
3
- factory.setLogWarnings(process.env.NODE_ENV === 'test' ? 'debug' : 'info');
3
+ factory.setLogWarnings('debug');
4
4
  export let logger = factory.getLogger('EVA-SDK');
5
5
  export const setLogLevel = (level) => {
6
6
  factory.setLogWarnings(level);
@@ -1 +1 @@
1
- {"version":3,"file":"eva-sdk-core-logger.js","sourceRoot":"","sources":["../src/eva-sdk-core-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;AAC3C,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,MAAM,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAe,EAAE,EAAE;IAC7C,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;IAC9C,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"eva-sdk-core-logger.js","sourceRoot":"","sources":["../src/eva-sdk-core-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;AAC3C,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAEhC,MAAM,CAAC,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAe,EAAE,EAAE;IAC7C,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;IAC9C,OAAO,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springtree/eva-sdk-core-logger",
3
- "version": "1.2.2",
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": "5b111111d3cc694ac129986f340005fcc544d191"
34
+ "gitHead": "e5a13ab2e6c139966aa0907cff56676c3b8753dd"
34
35
  }
package/CHANGELOG.md DELETED
@@ -1,190 +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.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)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **logger:** update when log level changes ([9530eee](https://github.com/springtreesolutions/eva-sdk-repo/commit/9530eeec8328cdaba50b02c10746daf7c2f347ae))
12
-
13
-
14
-
15
-
16
-
17
- ## [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)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * **logger:** new logger needs an invocation ([7d6b85b](https://github.com/springtreesolutions/eva-sdk-repo/commit/7d6b85badc364e04e379f478f4f3297bb5a11bde))
23
-
24
-
25
-
26
-
27
-
28
- # 1.2.0 (2022-01-18)
29
-
30
-
31
- ### Features
32
-
33
- * **logger:** replace browser-bunyan with lines-logger ([504d98e](https://github.com/springtreesolutions/eva-sdk-repo/commit/504d98e1f9e616436c153f4d62ce740c1a6523ff))
34
-
35
-
36
-
37
-
38
-
39
- ## 1.1.3 (2022-01-17)
40
-
41
-
42
- ### Bug Fixes
43
-
44
- * **logger:** add own log levels ([789ae29](https://github.com/springtreesolutions/eva-sdk-repo/commit/789ae29e19518feaa099753ef30758f95cf8d65b))
45
-
46
-
47
-
48
-
49
-
50
- ## 1.1.2 (2021-07-12)
51
-
52
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
53
-
54
-
55
-
56
-
57
-
58
- ## 1.1.1 (2021-02-22)
59
-
60
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
61
-
62
-
63
-
64
-
65
-
66
- # 1.1.0 (2021-02-22)
67
-
68
-
69
- ### Features
70
-
71
- * **sdk-react:** add wish list state ([99d567f](https://github.com/springtreesolutions/eva-sdk-repo/commit/99d567f5af7b2bd8a1ea3e3a4bf8700ae0ef8d87))
72
-
73
-
74
-
75
-
76
-
77
- ## 1.0.11 (2021-02-22)
78
-
79
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
80
-
81
-
82
-
83
-
84
-
85
- ## 1.0.10 (2021-02-22)
86
-
87
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
88
-
89
-
90
-
91
-
92
-
93
- ## 1.0.9 (2021-02-19)
94
-
95
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
96
-
97
-
98
-
99
-
100
-
101
- ## 1.0.8 (2021-02-19)
102
-
103
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
104
-
105
-
106
-
107
-
108
-
109
- ## 1.0.7 (2021-02-19)
110
-
111
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
112
-
113
-
114
-
115
-
116
-
117
- ## 1.0.6 (2021-02-19)
118
-
119
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
120
-
121
-
122
-
123
-
124
-
125
- ## 1.0.5 (2021-02-19)
126
-
127
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
128
-
129
-
130
-
131
-
132
-
133
- ## 1.0.4 (2021-02-19)
134
-
135
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
136
-
137
-
138
-
139
-
140
-
141
- ## 1.0.3 (2020-11-10)
142
-
143
-
144
- ### Bug Fixes
145
-
146
- * **logger:** set log level helper ([fd65e1a](https://github.com/springtreesolutions/eva-sdk-repo/commit/fd65e1a89fcf21e18b3fb9b6a46539373ab33cbe))
147
-
148
-
149
-
150
-
151
-
152
- ## [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)
153
-
154
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
155
-
156
-
157
-
158
-
159
-
160
- ## [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)
161
-
162
- **Note:** Version bump only for package @springtree/eva-sdk-core-logger
163
-
164
-
165
-
166
-
167
-
168
- # 1.0.0 (2019-09-20)
169
-
170
-
171
- ### Bug Fixes
172
-
173
- * **logger:** export log level enum ([7ceb5ce](https://github.com/springtreesolutions/eva-sdk-repo/commit/7ceb5ce))
174
- * **logger:** reduce default log level ([1ade71d](https://github.com/springtreesolutions/eva-sdk-repo/commit/1ade71d))
175
- * **logger:** restore debug logging for tests ([77d5d9b](https://github.com/springtreesolutions/eva-sdk-repo/commit/77d5d9b))
176
- * **logger:** set default level to info ([d39a9fd](https://github.com/springtreesolutions/eva-sdk-repo/commit/d39a9fd))
177
- * **logger:** use raw stream for node ([14a6db5](https://github.com/springtreesolutions/eva-sdk-repo/commit/14a6db5))
178
- * **logging:** support test env ([d4356ac](https://github.com/springtreesolutions/eva-sdk-repo/commit/d4356ac))
179
- * **npm:** add homepage ([72cf0b4](https://github.com/springtreesolutions/eva-sdk-repo/commit/72cf0b4))
180
- * **npm:** added typings ([835ce37](https://github.com/springtreesolutions/eva-sdk-repo/commit/835ce37))
181
- * **npm:** made packages public ([62b68eb](https://github.com/springtreesolutions/eva-sdk-repo/commit/62b68eb))
182
- * **package.json:** setup author and license ([cbc3c1b](https://github.com/springtreesolutions/eva-sdk-repo/commit/cbc3c1b))
183
- * **repo:** update to latest and apply coding style ([a2538a1](https://github.com/springtreesolutions/eva-sdk-repo/commit/a2538a1))
184
-
185
-
186
- ### Features
187
-
188
- * **core-logger:** added base logger ([f95f14d](https://github.com/springtreesolutions/eva-sdk-repo/commit/f95f14d))
189
- * **logger:** switched to browser-bunyan ([49b0121](https://github.com/springtreesolutions/eva-sdk-repo/commit/49b0121))
190
- * **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(process.env.NODE_ENV === 'test' ? 'debug' : 'info');
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(process.env.NODE_ENV === 'test' ? 'debug' : 'info');
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}