@jacraig/woodchuck 1.0.3 → 1.0.4
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
CHANGED
|
@@ -1 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WoodChuck - Logging Library
|
|
2
|
+
|
|
3
|
+
[](https://github.com/JaCraig/Woodchuck/actions/workflows/node-publish.yml)
|
|
4
|
+
|
|
5
|
+
WoodChuck is a versatile logging library for TypeScript/JavaScript that simplifies the process of logging messages within your applications and is built with structured event data at its heart. It provides a flexible and extensible logging framework to help you track and understand the flow of your application.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Easy Integration**: Simple setup for quick integration into your projects.
|
|
10
|
+
- **Customizable Logging Levels**: Define and use different logging levels to categorize and filter messages.
|
|
11
|
+
- **Extensible Plugins**: Extend functionality with plugins for various output formats and destinations.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i @jacraig/woodchuck
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
1. Configure the logger with a sink to output to.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
|
|
25
|
+
import { Logger, ConsoleSink } from '@jacraig/woodchuck';
|
|
26
|
+
|
|
27
|
+
Logger.configure()
|
|
28
|
+
.minimumLevel("Information")
|
|
29
|
+
.writeTo(new ConsoleSink())
|
|
30
|
+
.build();
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. Log messages with different levels:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
|
|
38
|
+
Logger.verbose("This is a verbose message: {key}", { "key": "value" });
|
|
39
|
+
Logger.debug("This is a debug message: {key}", { "key": "value" });
|
|
40
|
+
Logger.information("This is an information message: {key}", { "key": "value" });
|
|
41
|
+
Logger.warning("This is a warning message: {key}", { "key": "value" });
|
|
42
|
+
Logger.error("This is an error message: {key}", { "key": "value" }, new Error("This is an error"));
|
|
43
|
+
Logger.fatal("This is a fatal message: {key}", { "key": "value" }, new Error("This is a fatal error"));
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. Customize the logger with plugins:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerConfiguration.d.ts","sourceRoot":"","sources":["../../src/LoggerConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,qBAAa,mBAAmB;;IAG5B,OAAO,CAAC,SAAS,CAAyB;IAKnC,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB;IAS3C,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,eAAe;IAS9C,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe;IAS1C,WAAW,CAAC,SAAS,EAAE,eAAe,GAAG,eAAe;IASxD,UAAU,CAAC,QAAQ,EAAE,gBAAgB,GAAG,eAAe;IAWvD,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KAAE,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"LoggerConfiguration.d.ts","sourceRoot":"","sources":["../../src/LoggerConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,qBAAa,mBAAmB;;IAG5B,OAAO,CAAC,SAAS,CAAyB;IAKnC,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB;IAS3C,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,eAAe;IAS9C,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe;IAS1C,WAAW,CAAC,SAAS,EAAE,eAAe,GAAG,eAAe;IASxD,UAAU,CAAC,QAAQ,EAAE,gBAAgB,GAAG,eAAe;IAWvD,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KAAE,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI;CAWhH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jacraig/woodchuck",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A simple logging library.",
|
|
5
5
|
"main": "lib/Logger.cjs.js",
|
|
6
6
|
"module": "lib/Logger.esm.js",
|
|
@@ -11,8 +11,14 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"import":
|
|
15
|
-
|
|
14
|
+
"import": {
|
|
15
|
+
"default": "./lib/Logger.esm.js",
|
|
16
|
+
"types": "./lib/declarations/Logger.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"default": "./lib/Logger.cjs.js",
|
|
20
|
+
"types": "./lib/declarations/Logger.d.ts"
|
|
21
|
+
}
|
|
16
22
|
},
|
|
17
23
|
"./Logger.umd.js": "./lib/Logger.umd.js",
|
|
18
24
|
"./Logger.umd.min.js": "./lib/Logger.umd.min.js"
|
|
@@ -50,6 +56,7 @@
|
|
|
50
56
|
"rollup": "^4.9.4",
|
|
51
57
|
"semantic-release": "^23.0.0",
|
|
52
58
|
"tslib": "^2.6.2",
|
|
59
|
+
"typedoc": "^0.25.7",
|
|
53
60
|
"typescript": "^5.3.3"
|
|
54
61
|
},
|
|
55
62
|
"release": {
|