@logtape/windows-eventlog 2.2.0-dev.738 → 2.2.0-dev.743

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.
@@ -0,0 +1,34 @@
1
+ import { WindowsEventLogSinkOptions } from "./types.cjs";
2
+ import { Sink } from "@logtape/logtape";
3
+
4
+ //#region dist/sink.node.d.ts
5
+
6
+ //#region src/sink.node.d.ts
7
+ /**
8
+ * Creates a Windows Event Log sink for Node.js environments using FFI.
9
+ *
10
+ * This implementation uses koffi to call Windows Event Log API directly,
11
+ * providing high performance logging without external dependencies.
12
+ *
13
+ * @param options Configuration options for the sink
14
+ * @returns A LogTape sink that writes to Windows Event Log
15
+ * @throws {WindowsPlatformError} If not running on Windows
16
+ * @throws {WindowsEventLogError} If Event Log operations fail
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { getWindowsEventLogSink } from "@logtape/windows-eventlog";
21
+ *
22
+ * const sink = getWindowsEventLogSink({
23
+ * sourceName: "MyApp"
24
+ * });
25
+ * ```
26
+ *
27
+ * @since 1.0.0
28
+ */
29
+ declare function getWindowsEventLogSink(options: WindowsEventLogSinkOptions): Sink & Disposable;
30
+ //# sourceMappingURL=sink.node.d.ts.map
31
+ //#endregion
32
+ //#endregion
33
+ export { getWindowsEventLogSink };
34
+ //# sourceMappingURL=sink.node.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sink.node.d.cts","names":["WindowsEventLogSinkOptions","Sink","getWindowsEventLogSink","Disposable"],"sources":["../sink.node.d.ts"],"sourcesContent":["import { WindowsEventLogSinkOptions } from \"./types.js\";\nimport { Sink } from \"@logtape/logtape\";\n\n//#region src/sink.node.d.ts\n\n/**\n * Creates a Windows Event Log sink for Node.js environments using FFI.\n *\n * This implementation uses koffi to call Windows Event Log API directly,\n * providing high performance logging without external dependencies.\n *\n * @param options Configuration options for the sink\n * @returns A LogTape sink that writes to Windows Event Log\n * @throws {WindowsPlatformError} If not running on Windows\n * @throws {WindowsEventLogError} If Event Log operations fail\n *\n * @example\n * ```typescript\n * import { getWindowsEventLogSink } from \"@logtape/windows-eventlog\";\n *\n * const sink = getWindowsEventLogSink({\n * sourceName: \"MyApp\"\n * });\n * ```\n *\n * @since 1.0.0\n */\ndeclare function getWindowsEventLogSink(options: WindowsEventLogSinkOptions): Sink & Disposable;\n//# sourceMappingURL=sink.node.d.ts.map\n//#endregion\nexport { getWindowsEventLogSink };\n//# sourceMappingURL=sink.node.d.ts.map"],"mappings":";;;;;;;;;;AA2B+F;;;;;;;;;;;;;;;;;;iBAA9EE,sBAAAA,UAAgCF,6BAA6BC,OAAOE"}
@@ -0,0 +1,60 @@
1
+ import { LogLevel, TextFormatter } from "@logtape/logtape";
2
+
3
+ //#region dist/types.d.ts
4
+
5
+ //#region src/types.d.ts
6
+ /**
7
+ * Configuration options for the Windows Event Log sink.
8
+ * @since 1.0.0
9
+ */
10
+ interface WindowsEventLogSinkOptions {
11
+ /**
12
+ * The name of the event source. This is typically your application name
13
+ * and will appear as the "Source" in Windows Event Viewer.
14
+ *
15
+ * @example "MyApplication"
16
+ */
17
+ readonly sourceName: string;
18
+ /**
19
+ * The server name to write logs to. Use this for remote logging.
20
+ *
21
+ * @default undefined (local machine)
22
+ */
23
+ readonly serverName?: string;
24
+ /**
25
+ * Custom mapping of LogTape log levels to Windows Event IDs.
26
+ * Event IDs are numeric identifiers that can be used for filtering
27
+ * and automation in Windows Event Log.
28
+ *
29
+ * @default
30
+ * ```typescript
31
+ * {
32
+ * fatal: 1,
33
+ * error: 2,
34
+ * warning: 3,
35
+ * info: 4,
36
+ * debug: 5,
37
+ * trace: 6
38
+ * }
39
+ * ```
40
+ */
41
+ readonly eventIdMapping?: Partial<Record<LogLevel, number>>;
42
+ /**
43
+ * The text formatter to use.
44
+ * Defaults to {@link defaultWindowsEventlogFormatter}.
45
+ */
46
+ formatter?: TextFormatter;
47
+ }
48
+ /**
49
+ * Windows Event Log entry types mapped to LogTape levels.
50
+ * These correspond to the event types visible in Windows Event Viewer.
51
+ * @since 1.0.0
52
+ */
53
+
54
+ /**
55
+ * Platform validation error thrown when trying to use the sink on non-Windows platforms.
56
+ * @since 1.0.0
57
+ */
58
+ //#endregion
59
+ export { WindowsEventLogSinkOptions };
60
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":["LogLevel","TextFormatter","WindowsEventLogSinkOptions","Record","Partial","WindowsPlatformError","Error","WindowsEventLogError"],"sources":["../types.d.ts"],"sourcesContent":["import { LogLevel, TextFormatter } from \"@logtape/logtape\";\n\n//#region src/types.d.ts\n\n/**\n * Configuration options for the Windows Event Log sink.\n * @since 1.0.0\n */\ninterface WindowsEventLogSinkOptions {\n /**\n * The name of the event source. This is typically your application name\n * and will appear as the \"Source\" in Windows Event Viewer.\n *\n * @example \"MyApplication\"\n */\n readonly sourceName: string;\n /**\n * The server name to write logs to. Use this for remote logging.\n *\n * @default undefined (local machine)\n */\n readonly serverName?: string;\n /**\n * Custom mapping of LogTape log levels to Windows Event IDs.\n * Event IDs are numeric identifiers that can be used for filtering\n * and automation in Windows Event Log.\n *\n * @default\n * ```typescript\n * {\n * fatal: 1,\n * error: 2,\n * warning: 3,\n * info: 4,\n * debug: 5,\n * trace: 6\n * }\n * ```\n */\n readonly eventIdMapping?: Partial<Record<LogLevel, number>>;\n /**\n * The text formatter to use.\n * Defaults to {@link defaultWindowsEventlogFormatter}.\n */\n formatter?: TextFormatter;\n}\n/**\n * Windows Event Log entry types mapped to LogTape levels.\n * These correspond to the event types visible in Windows Event Viewer.\n * @since 1.0.0\n */\n\n/**\n * Platform validation error thrown when trying to use the sink on non-Windows platforms.\n * @since 1.0.0\n */\ndeclare class WindowsPlatformError extends Error {\n constructor(platform: string);\n}\n/**\n * Error thrown when Windows Event Log operations fail.\n * @since 1.0.0\n */\ndeclare class WindowsEventLogError extends Error {\n constructor(message: string, cause?: Error);\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\nexport { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;UAQUE,0BAAAA,CAoCID;EAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BALCG,QAAQD,OAAOH;;;;;cAK7BC"}
package/dist/mod.d.cts CHANGED
@@ -1,3 +1,3 @@
1
+ import { getWindowsEventLogSink } from "./dist/sink.node.cjs";
1
2
  import { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError } from "./types.cjs";
2
- import { getWindowsEventLogSink } from "#wineventlog";
3
3
  export { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError, getWindowsEventLogSink };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logtape/windows-eventlog",
3
- "version": "2.2.0-dev.738+bfb2df64",
3
+ "version": "2.2.0-dev.743+ad519499",
4
4
  "description": "Windows Event Log sink for LogTape",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -57,7 +57,7 @@
57
57
  "dist/"
58
58
  ],
59
59
  "peerDependencies": {
60
- "@logtape/logtape": "^2.2.0-dev.738+bfb2df64"
60
+ "@logtape/logtape": "^2.2.0-dev.743+ad519499"
61
61
  },
62
62
  "dependencies": {
63
63
  "koffi": "^2.10.0"