UNPKG

@logtape/windows-eventlog

Version:

Windows Event Log sink for LogTape

35 lines (33 loc) 1.04 kB
import { WindowsEventLogBunFFI } from "./ffi.bun.js"; import { getWindowsEventLogSinkForFFI } from "./sink.js"; //#region src/sink.bun.ts /** * Creates a Windows Event Log sink for Bun environments using FFI. * * This implementation uses Bun's native Foreign Function Interface to directly * call Windows Event Log APIs, providing high performance logging optimized * for the Bun runtime. * * @param options Configuration options for the sink * @returns A LogTape sink that writes to Windows Event Log * @throws {WindowsPlatformError} If not running on Windows * @throws {WindowsEventLogError} If Event Log operations fail * * @example * ```typescript * import { getWindowsEventLogSink } from "@logtape/windows-eventlog"; * * const sink = getWindowsEventLogSink({ * sourceName: "MyApp" * }); * ``` * * @since 1.0.0 */ function getWindowsEventLogSink(options) { const ffi = new WindowsEventLogBunFFI(); return getWindowsEventLogSinkForFFI(ffi, options); } //#endregion export { getWindowsEventLogSink }; //# sourceMappingURL=sink.bun.js.map