@adviser/cement 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +39 -0
  3. package/adviser-cement-0.0.1.tgz +0 -0
  4. package/file_service.d.ts +17 -0
  5. package/file_service.d.ts.map +1 -0
  6. package/file_service.js +3 -0
  7. package/file_service.js.map +1 -0
  8. package/index.d.ts +10 -0
  9. package/index.d.ts.map +1 -0
  10. package/index.js +26 -0
  11. package/index.js.map +1 -0
  12. package/logger.d.ts +31 -0
  13. package/logger.d.ts.map +1 -0
  14. package/logger.js +11 -0
  15. package/logger.js.map +1 -0
  16. package/logger.test.d.ts +2 -0
  17. package/logger.test.d.ts.map +1 -0
  18. package/logger.test.js +228 -0
  19. package/logger.test.js.map +1 -0
  20. package/logger_impl.d.ts +46 -0
  21. package/logger_impl.d.ts.map +1 -0
  22. package/logger_impl.js +260 -0
  23. package/logger_impl.js.map +1 -0
  24. package/mock_file_service.d.ts +20 -0
  25. package/mock_file_service.d.ts.map +1 -0
  26. package/mock_file_service.js +80 -0
  27. package/mock_file_service.js.map +1 -0
  28. package/node_file_service.d.ts +15 -0
  29. package/node_file_service.d.ts.map +1 -0
  30. package/node_file_service.js +78 -0
  31. package/node_file_service.js.map +1 -0
  32. package/node_sys_abstraction.d.ts +91 -0
  33. package/node_sys_abstraction.d.ts.map +1 -0
  34. package/node_sys_abstraction.js +265 -0
  35. package/node_sys_abstraction.js.map +1 -0
  36. package/node_sys_abstraction.test.d.ts +2 -0
  37. package/node_sys_abstraction.test.d.ts.map +1 -0
  38. package/node_sys_abstraction.test.js +123 -0
  39. package/node_sys_abstraction.test.js.map +1 -0
  40. package/package.json +40 -0
  41. package/sys_abstraction.d.ts +35 -0
  42. package/sys_abstraction.d.ts.map +1 -0
  43. package/sys_abstraction.js +35 -0
  44. package/sys_abstraction.js.map +1 -0
  45. package/test/log_collector.d.ts +22 -0
  46. package/test/log_collector.d.ts.map +1 -0
  47. package/test/log_collector.js +65 -0
  48. package/test/log_collector.js.map +1 -0
  49. package/test/mock_logger.d.ts +13 -0
  50. package/test/mock_logger.d.ts.map +1 -0
  51. package/test/mock_logger.js +23 -0
  52. package/test/mock_logger.js.map +1 -0
  53. package/test/mock_logger.test.d.ts +2 -0
  54. package/test/mock_logger.test.d.ts.map +1 -0
  55. package/test/mock_logger.test.js +49 -0
  56. package/test/mock_logger.test.js.map +1 -0
  57. package/test/test-exit-handler.d.ts +1 -0
  58. package/test/test-exit-handler.d.ts.map +1 -0
  59. package/test/test-exit-handler.js +76 -0
  60. package/test/test-exit-handler.js.map +1 -0
  61. package/time.d.ts +13 -0
  62. package/time.d.ts.map +1 -0
  63. package/time.js +18 -0
  64. package/time.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # cement
2
+
3
+ An Agnostic Platform Wrapper
4
+
5
+ which Provides:
6
+
7
+ - SysAbstraction
8
+ ```typescript
9
+ export interface SysAbstraction {
10
+ Time(): Time;
11
+ Stdout(): WritableStream<Uint8Array>;
12
+ Stderr(): WritableStream<Uint8Array>;
13
+ NextId(): string;
14
+ Random0ToValue(value: number): number;
15
+ System(): SystemService;
16
+ FileSystem(): FileService;
17
+ }
18
+ ```
19
+ - Logger inspired from golang zlogger
20
+ ```typescript
21
+ export interface LoggerInterface<R> {
22
+ Module(key: string): R;
23
+ SetDebug(...modules: (string | string[])[]): R;
24
+
25
+ Str(key: string, value: string): R;
26
+ Error(): R;
27
+ Warn(): R;
28
+ Debug(): R;
29
+ Log(): R;
30
+ WithLevel(level: Level): R;
31
+
32
+ Err(err: unknown): R; // could be Error, or something which coerces to string
33
+ Info(): R;
34
+ Timestamp(): R;
35
+ Any(key: string, value: unknown): R;
36
+ Dur(key: string, nsec: number): R;
37
+ Uint64(key: string, value: number): R;
38
+ }
39
+ ```
Binary file
@@ -0,0 +1,17 @@
1
+ export interface NamedWritableStream {
2
+ readonly name: string;
3
+ readonly stream: WritableStream<Uint8Array>;
4
+ }
5
+ export interface FileService {
6
+ readonly baseDir: string;
7
+ create(fname: string): Promise<NamedWritableStream>;
8
+ readFileString(fname: string): Promise<string>;
9
+ abs(fname: string): string;
10
+ join(...paths: string[]): string;
11
+ relative(from: string, to?: string): string;
12
+ dirname(fname: string): string;
13
+ basename(fname: string): string;
14
+ nodeImport(fname: string): string;
15
+ isAbsolute(fname: string): boolean;
16
+ }
17
+ //# sourceMappingURL=file_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file_service.d.ts","sourceRoot":"","sources":["../src/file_service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAEjC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5C,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACpC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=file_service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file_service.js","sourceRoot":"","sources":["../src/file_service.ts"],"names":[],"mappings":""}
package/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./file_service";
2
+ export * from "./logger_impl";
3
+ export * from "./logger";
4
+ export * from "./mock_file_service";
5
+ export * from "./node_sys_abstraction";
6
+ export * from "./sys_abstraction";
7
+ export * from "./time";
8
+ export * from "./test/log_collector";
9
+ export * from "./test/mock_logger";
10
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
package/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./file_service"), exports);
18
+ __exportStar(require("./logger_impl"), exports);
19
+ __exportStar(require("./logger"), exports);
20
+ __exportStar(require("./mock_file_service"), exports);
21
+ __exportStar(require("./node_sys_abstraction"), exports);
22
+ __exportStar(require("./sys_abstraction"), exports);
23
+ __exportStar(require("./time"), exports);
24
+ __exportStar(require("./test/log_collector"), exports);
25
+ __exportStar(require("./test/mock_logger"), exports);
26
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,sDAAoC;AACpC,yDAAuC;AACvC,oDAAkC;AAClC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC"}
package/logger.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ export declare enum Level {
2
+ WARN = "warn",
3
+ DEBUG = "debug",
4
+ INFO = "info",
5
+ ERROR = "error"
6
+ }
7
+ export interface LoggerInterface<R> {
8
+ Module(key: string): R;
9
+ SetDebug(...modules: (string | string[])[]): R;
10
+ Str(key: string, value: string): R;
11
+ Error(): R;
12
+ Warn(): R;
13
+ Debug(): R;
14
+ Log(): R;
15
+ WithLevel(level: Level): R;
16
+ Err(err: unknown): R;
17
+ Info(): R;
18
+ Timestamp(): R;
19
+ Any(key: string, value: unknown): R;
20
+ Dur(key: string, nsec: number): R;
21
+ Uint64(key: string, value: number): R;
22
+ }
23
+ export interface WithLogger extends LoggerInterface<WithLogger> {
24
+ Logger(): Logger;
25
+ }
26
+ export interface Logger extends LoggerInterface<Logger> {
27
+ With(): WithLogger;
28
+ Msg(...args: string[]): void;
29
+ Flush(): Promise<void>;
30
+ }
31
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":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strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Level = void 0;
4
+ var Level;
5
+ (function (Level) {
6
+ Level["WARN"] = "warn";
7
+ Level["DEBUG"] = "debug";
8
+ Level["INFO"] = "info";
9
+ Level["ERROR"] = "error";
10
+ })(Level || (exports.Level = Level = {}));
11
+ //# sourceMappingURL=logger.js.map
package/logger.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAAA,IAAY,KAKX;AALD,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,wBAAe,CAAA;IACf,sBAAa,CAAA;IACb,wBAAe,CAAA;AACjB,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logger.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.test.d.ts","sourceRoot":"","sources":["../src/logger.test.ts"],"names":[],"mappings":""}
package/logger.test.js ADDED
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const logger_impl_1 = require("./logger_impl");
4
+ const log_collector_1 = require("./test/log_collector");
5
+ const logger_1 = require("./logger");
6
+ const sys_abstraction_1 = require("./sys_abstraction");
7
+ const node_sys_abstraction_1 = require("./node_sys_abstraction");
8
+ describe("TestLogger", () => {
9
+ let logCollector;
10
+ let logger;
11
+ beforeEach(() => {
12
+ logCollector = new log_collector_1.LogCollector();
13
+ logger = new logger_impl_1.LoggerImpl({
14
+ out: logCollector,
15
+ sys: new node_sys_abstraction_1.NodeSysAbstraction({ TimeMode: sys_abstraction_1.TimeMode.STEP }),
16
+ });
17
+ });
18
+ describe("Error()", () => {
19
+ it("should set the level attribute to error", async () => {
20
+ logger.Error().Msg("");
21
+ await logger.Flush();
22
+ expect(logCollector.Logs()).toEqual([{ level: "error" }]);
23
+ });
24
+ it("should set the error message", async () => {
25
+ logger.Err(new Error("test")).Msg("");
26
+ await logger.Flush();
27
+ expect(logCollector.Logs()).toEqual([{ error: "test" }]);
28
+ });
29
+ it("should set the error from string", async () => {
30
+ logger.Err("test").Msg("");
31
+ await logger.Flush();
32
+ expect(logCollector.Logs()).toEqual([{ error: "test" }]);
33
+ });
34
+ it("should set the error from bool", async () => {
35
+ logger.Err(false).Msg("");
36
+ await logger.Flush();
37
+ expect(logCollector.Logs()).toEqual([{ error: "false" }]);
38
+ });
39
+ });
40
+ describe("Info()", () => {
41
+ it("should set the level attribute to info", async () => {
42
+ logger.Info().Msg("");
43
+ await logger.Flush();
44
+ expect(logCollector.Logs()).toEqual([{ level: "info" }]);
45
+ });
46
+ });
47
+ describe("Any()", () => {
48
+ it("should set the Any attribute", async () => {
49
+ logger.Any("key", "value").Msg("");
50
+ await logger.Flush();
51
+ expect(logCollector.Logs()).toEqual([{ key: "value" }]);
52
+ });
53
+ });
54
+ describe("Dur()", () => {
55
+ it("should set the Dur attribute", async () => {
56
+ logger.Dur("key", 123).Msg("");
57
+ await logger.Flush();
58
+ expect(logCollector.Logs()).toEqual([{ key: "123ms" }]);
59
+ });
60
+ });
61
+ describe("Uint64()", () => {
62
+ it("should set the Uint64 / number attribute", async () => {
63
+ logger.Uint64("Hey", 123).Msg("");
64
+ await logger.Flush();
65
+ expect(logCollector.Logs()).toEqual([{ Hey: 123 }]);
66
+ });
67
+ });
68
+ describe("Str()", () => {
69
+ it("should set the String attribute", async () => {
70
+ logger.Str("key", "value").Msg("");
71
+ await logger.Flush();
72
+ expect(logCollector.Logs()).toEqual([{ key: "value" }]);
73
+ });
74
+ });
75
+ describe("With()", () => {
76
+ it("should return a new logger with the same attributes", async () => {
77
+ const log = logger.With().Str("key", "value").Logger();
78
+ const newLogger = log.With().Str("str", "str").Logger();
79
+ logger.Msg("logger1");
80
+ logger.Msg("logger2");
81
+ newLogger.Msg("newLogger1");
82
+ newLogger.Msg("newLogger2");
83
+ log.Info().Msg("log1");
84
+ log.Info().Msg("log2");
85
+ await log.Flush();
86
+ expect(logCollector.Logs()).toEqual([
87
+ { msg: "logger1" },
88
+ { msg: "logger2" },
89
+ { key: "value", msg: "newLogger1", str: "str" },
90
+ { key: "value", msg: "newLogger2", str: "str" },
91
+ { level: "info", key: "value", msg: "log1" },
92
+ { level: "info", key: "value", msg: "log2" },
93
+ ]);
94
+ });
95
+ });
96
+ describe("Timestamp()", () => {
97
+ it("should set the Timestamp attribute", async () => {
98
+ const WithConstant = logger.With().Str("key", "withconstant").Str("key1", "anotherone").Logger();
99
+ const timelog = WithConstant.With().Timestamp().Str("key", "withconstant2").Logger();
100
+ timelog.Msg("1");
101
+ timelog.Msg("2");
102
+ timelog.Timestamp().Msg("3");
103
+ await timelog.Flush();
104
+ const timer = (0, node_sys_abstraction_1.TimeFactory)(sys_abstraction_1.TimeMode.STEP);
105
+ expect(logCollector.Logs()).toEqual([
106
+ {
107
+ key: "withconstant2",
108
+ key1: "anotherone",
109
+ ts: timer.Now().toISOString(),
110
+ msg: "1",
111
+ },
112
+ {
113
+ key: "withconstant2",
114
+ key1: "anotherone",
115
+ ts: timer.Now().toISOString(),
116
+ msg: "2",
117
+ },
118
+ {
119
+ key: "withconstant2",
120
+ key1: "anotherone",
121
+ ts: timer.Now().toISOString(),
122
+ msg: "3",
123
+ },
124
+ ]);
125
+ });
126
+ it("should NOT set the Timestamp attribute", async () => {
127
+ const timelog = logger.With().Logger();
128
+ timelog.Msg("1");
129
+ timelog.Msg("2");
130
+ timelog.Timestamp().Msg("3");
131
+ await timelog.Flush();
132
+ const timer = (0, node_sys_abstraction_1.TimeFactory)(sys_abstraction_1.TimeMode.STEP);
133
+ expect(logCollector.Logs()).toEqual([
134
+ { msg: "1" },
135
+ { msg: "2" },
136
+ {
137
+ ts: timer.Now().toISOString(),
138
+ msg: "3",
139
+ },
140
+ ]);
141
+ });
142
+ });
143
+ it("remove empty msg", async () => {
144
+ const log = logger;
145
+ log.Warn().Msg();
146
+ await log.Flush();
147
+ expect(logCollector.Logs()).toEqual([{ level: "warn" }]);
148
+ });
149
+ it("check log level", async () => {
150
+ const log = logger.With().Module("test").Logger().With().Logger();
151
+ log.Warn().Msg("Warn");
152
+ log.Info().Msg("Info");
153
+ log.Error().Msg("Error");
154
+ log.Log().Msg("Log");
155
+ log.WithLevel(logger_1.Level.ERROR).Msg("WithLevel");
156
+ log.Debug().Str("should", "reset").Msg("Debug");
157
+ log.Info().Str("what", "the").Msg("Simple");
158
+ await log.Flush();
159
+ const expected = [
160
+ { msg: "Warn", level: "warn", module: "test" },
161
+ { msg: "Info", level: "info", module: "test" },
162
+ { msg: "Error", level: "error", module: "test" },
163
+ { msg: "Log", module: "test" },
164
+ { msg: "WithLevel", level: "error", module: "test" },
165
+ { level: "info", module: "test", msg: "Simple", what: "the" },
166
+ ];
167
+ expect(logCollector.Logs()).toEqual(expected);
168
+ logCollector.Logs().splice(0, logCollector.Logs().length);
169
+ logger.With().Logger().SetDebug("test");
170
+ log.Debug().Msg("Debug1");
171
+ await log.Flush();
172
+ expect(logCollector.Logs()).toEqual([...expected, { msg: "Debug1", level: "debug", module: "test" }]);
173
+ });
174
+ it("should flush all logs", async () => {
175
+ const log = new logger_impl_1.LoggerImpl();
176
+ log.Info().Msg("1");
177
+ log.Info().Msg("2");
178
+ await log.Flush();
179
+ log.Info().Msg("DONE");
180
+ return log.Flush();
181
+ });
182
+ it("carry debug", async () => {
183
+ const log = logger;
184
+ log.Module("xxx").SetDebug("yyy", ["i , xxx"]);
185
+ log.Debug().Msg("Debug1");
186
+ const next1 = log.With().Str("next1", "meno").Logger();
187
+ next1.Debug().Msg("Next1");
188
+ const next2 = next1.With().Str("next2", "meno").Logger();
189
+ next2.Debug().Msg("Next2");
190
+ next2.Module("zzz");
191
+ next2.Debug().Msg("Next3");
192
+ log.Debug().Msg("Top");
193
+ next1.Debug().Msg("Next1");
194
+ await log.Flush();
195
+ expect(logCollector.Logs()).toEqual([
196
+ {
197
+ level: "debug",
198
+ module: "xxx",
199
+ msg: "Debug1",
200
+ },
201
+ {
202
+ level: "debug",
203
+ module: "xxx",
204
+ msg: "Next1",
205
+ next1: "meno",
206
+ },
207
+ {
208
+ level: "debug",
209
+ module: "xxx",
210
+ msg: "Next2",
211
+ next1: "meno",
212
+ next2: "meno",
213
+ },
214
+ {
215
+ level: "debug",
216
+ module: "xxx",
217
+ msg: "Top",
218
+ },
219
+ {
220
+ level: "debug",
221
+ module: "xxx",
222
+ msg: "Next1",
223
+ next1: "meno",
224
+ },
225
+ ]);
226
+ });
227
+ });
228
+ //# sourceMappingURL=logger.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.test.js","sourceRoot":"","sources":["../src/logger.test.ts"],"names":[],"mappings":";;AAAA,+CAA2C;AAC3C,wDAAoD;AAEpD,qCAAyC;AACzC,uDAA6C;AAC7C,iEAAyE;AAEzE,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,YAA0B,CAAC;IAC/B,IAAI,MAAc,CAAC;IAEnB,UAAU,CAAC,GAAG,EAAE;QACd,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC;QAClC,MAAM,GAAG,IAAI,wBAAU,CAAC;YACtB,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,IAAI,yCAAkB,CAAC,EAAE,QAAQ,EAAE,0BAAQ,CAAC,IAAI,EAAE,CAAC;SACzD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACvD,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACvB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC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