echo/types/index.ts
creations 7b02602e86
All checks were successful
Code quality checks / biome (push) Successful in 12s
add subDirectory option, move @ to # in relative paths, fix builder
2025-06-13 20:21:45 -04:00

59 lines
1.1 KiB
TypeScript

import type { ansiColors, logLevelValues } from "#lib/config";
type LogLevelValue = (typeof logLevelValues)[keyof typeof logLevelValues];
type LogLevel = keyof typeof logLevelValues;
type LoggerConfig = {
directory?: string;
level?: LogLevel;
disableFile?: boolean;
rotate?: boolean;
maxFiles?: number | null;
fileNameFormat?: string;
subDirectory?: string | null;
console?: boolean;
consoleColor?: boolean;
dateFormat?: string;
timezone?: string;
silent?: boolean;
pattern?: string;
levelColor?: Partial<Record<LogLevel, keyof typeof ansiColors>>;
customPattern?: string;
customColors?: Record<string, keyof typeof ansiColors>;
prettyPrint?: boolean;
};
type PatternContext = {
level: LogLevel;
data: unknown;
config: Required<LoggerConfig>;
};
interface PatternTokens {
timestamp?: string;
prettyTimestamp?: string;
levelName?: string;
level?: string;
fileName?: string;
line?: string;
column?: string;
data?: string;
id?: string;
tag?: string;
context?: string;
}
export type {
LogLevel,
LogLevelValue,
LoggerConfig,
PatternContext,
PatternTokens,
};