@fjell/logging
Version:
Logging for Fjell
30 lines (29 loc) • 1.31 kB
TypeScript
import * as LogFormat from "./LogFormat";
import * as LogLevel from "./LogLevel";
import { FloodControlConfig } from "./FloodControl";
import { MaskingConfig } from "./utils/maskSensitive";
export type ComponentOverride = {
logLevel: LogLevel.Config;
components?: Record<string, ComponentOverride>;
};
export type LoggingConfig = {
logFormat: LogFormat.Config;
logLevel: LogLevel.Config;
overrides: Record<string, ComponentOverride>;
floodControl: FloodControlConfig;
masking: MaskingConfig;
};
export declare const defaultLoggingConfig: LoggingConfig;
export declare const convertOverrides: (overrides: any) => Record<string, ComponentOverride>;
export declare const convertConfig: (config: any) => LoggingConfig;
/**
* Resolves the log level for a given category and component path by walking
* the component hierarchy in the configuration.
*
* @param config - The logging configuration
* @param category - The logger category (e.g., '@fjell/cache')
* @param components - Array of component names (e.g., ['CacheWarmer', 'SubComponent'])
* @returns The resolved log level configuration
*/
export declare const resolveLogLevel: (config: LoggingConfig, category: string, components: string[]) => LogLevel.Config;
export declare const configureLogging: () => LoggingConfig;