UNPKG

cerevox

Version:

TypeScript SDK for browser automation and secure command execution in highly available and scalable micro computer environments

55 lines 1.48 kB
import 'reflect-metadata'; import type { Logger as PinoLogger } from 'pino'; /** * Logger配置接口 */ interface LoggerConfig { key?: string; additionalBindings?: Record<string, any>; logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'fatal'; } /** * Logger装饰器 - 用于自动配置类的logger * 支持新旧装饰器模式 */ export declare function WithLogger(config?: LoggerConfig): (target: any, context?: ClassDecoratorContext) => void; /** * Logger装饰器 - 自动使用类名作为key * 支持新旧装饰器模式 */ export declare function Logger(additionalBindings?: Record<string, any>): (target: any, context?: ClassDecoratorContext) => void; /** * 基类,为所有core模块提供统一的logger初始化功能 */ export declare abstract class BaseClass { /** * 类专用的logger实例 */ protected readonly logger: PinoLogger; /** * 类名标识 */ protected readonly className: string; /** * 构造函数 * 自动从装饰器元数据中获取logger配置 */ constructor(logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'fatal'); /** * 获取类名 */ getClassName(): string; /** * 获取logger实例 */ getLogger(): PinoLogger; /** * 创建子logger */ protected createChildLogger(bindings: Record<string, any>): PinoLogger; } /** * 导出类型 */ export type { LoggerConfig }; //# sourceMappingURL=base.d.ts.map