UNPKG

@logtape/windows-eventlog

Version:

Windows Event Log sink for LogTape

65 lines (62 loc) 1.68 kB
import { LogLevel } from "@logtape/logtape"; //#region types.d.ts /** * Configuration options for the Windows Event Log sink. * @since 1.0.0 */ interface WindowsEventLogSinkOptions { /** * The name of the event source. This is typically your application name * and will appear as the "Source" in Windows Event Viewer. * * @example "MyApplication" */ readonly sourceName: string; /** * The server name to write logs to. Use this for remote logging. * * @default undefined (local machine) */ readonly serverName?: string; /** * Custom mapping of LogTape log levels to Windows Event IDs. * Event IDs are numeric identifiers that can be used for filtering * and automation in Windows Event Log. * * @default * ```typescript * { * fatal: 1, * error: 2, * warning: 3, * info: 4, * debug: 5, * trace: 6 * } * ``` */ readonly eventIdMapping?: Partial<Record<LogLevel, number>>; } /** * Windows Event Log entry types mapped to LogTape levels. * These correspond to the event types visible in Windows Event Viewer. * @since 1.0.0 */ /** * Platform validation error thrown when trying to use the sink on non-Windows platforms. * @since 1.0.0 */ declare class WindowsPlatformError extends Error { constructor(platform: string); } /** * Error thrown when Windows Event Log operations fail. * @since 1.0.0 */ declare class WindowsEventLogError extends Error { constructor(message: string, cause?: Error); } //# sourceMappingURL=types.d.ts.map //#endregion export { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError }; //# sourceMappingURL=types.d.cts.map