archunit
Version:
ArchUnit TypeScript is an architecture testing library, to specify and assert architecture rules in your TypeScript app
51 lines (50 loc) • 2.08 kB
TypeScript
import { LoggingOptions, Logger } from '../logging/types';
/**
* CheckLogger is designed to output logging information during the execution of architectural checks.
* It creates a single log file per instance and supports both console and file logging.
*/
declare class CheckLogger implements Logger {
private readonly logFilePath;
private isFileInitialized;
constructor();
/**
* Determines whether to log to console based on options
*/
private shouldLogToConsole;
/**
* Determines whether to log to file based on options
*/
private shouldLogToFile;
/**
* Determines if the given log level should be logged based on the configured minimum level
*/
private shouldLogLevel; /**
* Prepares file for writing if needed
*/
private prepareFileWriting;
/**
* Writes message to file if file logging is enabled
*/
private writeToFile;
/**
* Formats log message with level and arguments
*/
private formatMessage;
debug(options: LoggingOptions | undefined, message: string, ...args: unknown[]): void;
info(options: LoggingOptions | undefined, message: string, ...args: unknown[]): void;
warn(options: LoggingOptions | undefined, message: string, ...args: unknown[]): void;
error(options: LoggingOptions | undefined, message: string, ...args: unknown[]): void;
/**
* Gets the path to the log file for this logger instance
*/
getLogFilePath(): string;
isEnabled(): boolean;
startCheck(ruleName: string, options?: LoggingOptions): void;
endCheck(ruleName: string, violationCount: number, options?: LoggingOptions): void;
logViolation(violation: string, options?: LoggingOptions): void;
logProgress(message: string, options?: LoggingOptions): void;
logMetric(metricName: string, value: number, threshold?: number, options?: LoggingOptions): void;
logFileProcessing(fileName: string, matchedRules: number, options?: LoggingOptions): void;
}
export declare const sharedLogger: CheckLogger;
export { CheckLogger };