coakka-logger-node 1.2.2 → 1.2.3
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/README.md +32 -0
- package/dist/packaging.d.ts +1 -1
- package/dist/packaging.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,38 @@ cd coakka-samples
|
|
|
25
25
|
bash run.sh logger node basic
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
No-checkout npm smoke:
|
|
29
|
+
https://github.com/phuong-tran/coakka-samples/blob/main/docs/first-npm-smoke.md
|
|
30
|
+
|
|
31
|
+
Try the npm package without cloning any CoAkka repo:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
mkdir coakka-logger-first-run
|
|
35
|
+
cd coakka-logger-first-run
|
|
36
|
+
npm init -y
|
|
37
|
+
npm install coakka-logger-node@1.2.3
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import { CoakkaLoggerLevel, Logger } from "coakka-logger-node";
|
|
42
|
+
|
|
43
|
+
const logger = Logger.start({
|
|
44
|
+
systemName: "first-user-logger",
|
|
45
|
+
minLevel: CoakkaLoggerLevel.INFO,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const sequence = logger.info("first.user", JSON.stringify({ hello: "logger" }));
|
|
50
|
+
const record = logger.awaitNext(1000);
|
|
51
|
+
if (sequence == null || record == null) {
|
|
52
|
+
throw new Error("expected one accepted and drained log record");
|
|
53
|
+
}
|
|
54
|
+
console.log({ sequence: record.sequence, category: record.category });
|
|
55
|
+
} finally {
|
|
56
|
+
logger.close();
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
28
60
|
It mirrors the Python logger lane:
|
|
29
61
|
|
|
30
62
|
- load `libcoakka_logger_core` through `koffi`
|
package/dist/packaging.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LOGGER_NODE_VERSION = "1.2.
|
|
1
|
+
export declare const LOGGER_NODE_VERSION = "1.2.3";
|
|
2
2
|
export declare const LOGGER_NATIVE_CORE_VERSION = "1.2.1";
|
|
3
3
|
export declare const LOGGER_NATIVE_GIT_COMMIT = "f50756ebff0d";
|
|
4
4
|
export declare const LOGGER_NATIVE_PACKAGE_VERSION = "1.2.1+f50756ebff0d";
|
package/dist/packaging.js
CHANGED