auto-gpt-ts
Version:
my take of Auto-GPT in typescript
42 lines (41 loc) • 1.54 kB
TypeScript
export type LogFunction = (message: string, jsonObject?: Record<string, any>) => void;
export interface ILogger {
info: LogFunction;
warn: LogFunction;
error: LogFunction;
debug: LogFunction;
}
export declare enum LogLevel {
INFO = "info",
WARN = "warn",
ERROR = "error",
DEBUG = "debug",
SILENT = "silent"
}
export declare const noop: () => void;
export declare class Logger implements ILogger {
private logger;
static noDebug: boolean;
static logLevel: LogLevel;
static useTypewriterAffect: boolean;
static logLevelToNumber(logLevel: LogLevel): number;
private prefixes;
private logFrefixString;
constructor(logger: ILogger, ...prefixes: string[]);
static addTask<T>(task: () => Promise<T>): Promise<T>;
private static isLooping;
private static loop;
private static taskStack;
private static typewriterTyper;
private typewriter;
private createLogFunction;
get info(): (() => void) | ((message: string, jsonObject?: Record<string, any>) => Promise<void>);
get warn(): (() => void) | ((message: string, jsonObject?: Record<string, any>) => Promise<void>);
get error(): (() => void) | ((message: string, jsonObject?: Record<string, any>) => Promise<void>);
get debug(): (() => void) | ((message: string, jsonObject?: Record<string, any>) => Promise<void>);
}
export declare class Loggable {
protected logger: Logger;
constructor(...prefixes: string[]);
}
export declare function getLogger(...prefixes: string[]): Logger;