UNPKG

@artinet/sdk

Version:

A TypeScript SDK for building collaborative AI agents.

51 lines (50 loc) 1.49 kB
/** * Copyright 2025 The Artinet Project * SPDX-License-Identifier: Apache-2.0 * * @fileoverview Winston logger adapter for Artinet SDK. * * Lightweight wrapper that adapts a user-configured Winston instance * to the SDK's ILogger interface. * * @module @artinet/sdk/winston * * @example * ```typescript * import winston from 'winston'; * import { configure } from '@artinet/sdk'; * import { configureWinston } from '@artinet/sdk/winston'; * * // User configures their own winston instance * const winstonLogger = winston.createLogger({ * level: 'debug', * transports: [new winston.transports.Console()] * }); * * // Wrap and configure SDK * configure({ logger: configureWinston(winstonLogger) }); * ``` */ import type { Logger as WinstonLogger } from "winston"; import type { ILogger } from "../config/observability.js"; /** * Wrap a Winston logger instance to implement ILogger. * * @param winstonLogger - User-configured Winston logger instance * @returns ILogger implementation * * @example * ```typescript * import winston from 'winston'; * import { configure } from '@artinet/sdk'; * import { configureWinston } from '@artinet/sdk/winston'; * * const myWinston = winston.createLogger({ * level: 'debug', * transports: [new winston.transports.Console()] * }); * configure({ logger: configureWinston(myWinston) }); * ``` */ export declare function configureWinston(winstonLogger: WinstonLogger): ILogger; export default configureWinston;