import { ICommonTargetOptions, LogLevel, ILogEntry, StrToLogLevel, ILogRule, ITargetsOption, LogTarget, Log, LogFilter, ILogFilterOptions, ILogTargetDesc } from "@spinajs/log-common"; /** * Default log implementation interface. Taken from bunyan. Feel free to implement own. */ export declare class FrameworkLogger extends Log { Name: string; protected Parent?: Log | undefined; protected Filters: LogFilter[]; CaptureCallsite: boolean; constructor(Name: string, variables?: Record, Parent?: Log | undefined); resolve(): void; trace(message: string, ...args: any[]): void; trace(err: Error, message: string, ...args: any[]): void; trace(fields: object, message?: string, ...args: any[]): void; debug(message: string, ...args: any[]): void; debug(err: Error, message: string, ...args: any[]): void; debug(fields: object, message?: string, ...args: any[]): void; info(message: string, ...args: any[]): void; info(err: Error, message: string, ...args: any[]): void; info(fields: object, message?: string, ...args: any[]): void; warn(message: string, ...args: any[]): void; warn(err: Error, message: string, ...args: any[]): void; warn(fields: object, message?: string, ...args: any[]): void; error(message: string, ...args: any[]): void; error(err: Error, message: string, ...args: any[]): void; error(fields: object, message?: string, ...args: any[]): void; fatal(message: string, ...args: any[]): void; fatal(err: Error, message: string, ...args: any[]): void; fatal(fields: object, message?: string, ...args: any[]): void; security(message: string, ...args: any[]): void; security(err: Error, message: string, ...args: any[]): void; security(fields: object, message?: string, ...args: any[]): void; success(message: string, ...args: any[]): void; success(err: Error, message: string, ...args: any[]): void; success(fields: object, message?: string, ...args: any[]): void; write(entry: ILogEntry): Promise[]>; protected resolveLogTargets(): void; /** * Build one {@link ILogTargetDesc } from a target definition, its level * WINDOWS and a representative rule. Shared by config-time * {@link resolveLogTargets } and the runtime {@link addTarget } so both * resolve the target instance and its per-target filters the SAME way: * the target class is resolved by its DI string `type`, and each per-target * filter spec is resolved by its DI string `type` ( @NewInstance => per-use * state ). */ protected buildTargetDesc(def: ITargetsOption, ranges: { min: LogLevel; max: LogLevel; }[], rule: ILogRule): ILogTargetDesc; /** * Recompute the two cheap gates that {@link write } / the per-method * isEnabled() guard rely on, so they stay correct after the target set * changes at runtime ( {@link addTarget } / {@link removeTarget } ): * - MinLevel = lowest `min` across all attached targets' windows ( floor * Trace when there are none ), so a call below it is short-circuited. * - CaptureCallsite = true iff some attached target's layout references * ${callsite}, gating the caller-frame capture in wrapWrite. */ protected recomputeGates(): void; /** * Attach a sink to THIS logger AT RUNTIME, without touching config. Resolves * the target ( and its per-target filters ) exactly as config-time routing * does, then recomputes the MinLevel / ${callsite} gates so dispatch stays * correct. Returns the resolved instance, or `undefined` when nothing was * attached ( `def.enabled === false` ). * * A level WINDOW `[opts.level ?? "trace", opts.maxLevel ?? security]` is * applied ( same semantics as a routing rule's window ). Adding a target * whose name already exists REPLACES the existing descriptor(s) ( the old * instance is flushed first ) so a name is never duplicated. * * `opts.filters` are APPENDED to any `def.filters` ( def first, opts last ). */ addTarget(def: ITargetsOption, opts?: { level?: keyof typeof StrToLogLevel; maxLevel?: keyof typeof StrToLogLevel; filters?: ILogFilterOptions[]; }): LogTarget | undefined; /** * Detach a runtime sink by its target `name`. Each matching descriptor's * instance is force-flushed ( to drain buffered entries ) BEFORE removal - it * is NOT disposed, since the instance may be shared / DI-owned. Recomputes the * gates afterwards. No-op when no target with that name is attached. */ removeTarget(name: string): Promise; protected matchRulesToLogger(): void; } //# sourceMappingURL=log.d.ts.map