@graphql-hive/logger-json
Version:
30 lines (27 loc) • 965 B
text/typescript
import { Logger, LazyLoggerMessage } from '@graphql-mesh/types';
import { LogLevel } from '@graphql-mesh/utils';
interface JSONLoggerOptions {
name?: string;
meta?: Record<string, any>;
level?: LogLevel;
console?: Console;
}
declare global {
var DEBUG: string;
}
declare class JSONLogger implements Logger {
name?: string;
meta: Record<string, any>;
logLevel: LogLevel;
console: Console;
constructor(opts?: JSONLoggerOptions);
log(...messageArgs: LazyLoggerMessage[]): void;
warn(...messageArgs: LazyLoggerMessage[]): void;
info(...messageArgs: LazyLoggerMessage[]): void;
error(...messageArgs: LazyLoggerMessage[]): void;
debug(...messageArgs: LazyLoggerMessage[]): void;
child(nameOrMeta: string | Record<string, string | number>): JSONLogger;
addPrefix(prefix: string | Record<string, string | number>): this;
private prepareFinalMessage;
}
export { JSONLogger, type JSONLoggerOptions };