import spdlog from 'spdlog'; import { RPCService } from '@opensumi/ide-connection'; import { BaseLogServiceOptions, DebugLog, IBaseLogService, ILogService, ILogServiceForClient, ILogServiceManager, ILogServiceOptions, LogLevel, SupportLogNamespace } from '../common/'; export declare const DEFAULT_LOG_FOLDER: string; type SpdLogger = spdlog.RotatingLogger; interface ILog { level: LogLevel; message: string; } export declare const LogLevelMessageMap: { 0: string; 1: string; 2: string; 3: string; 4: string; 5: string; }; export declare class BaseLogService implements IBaseLogService { protected namespace: string; protected logger: SpdLogger | undefined; protected buffer: ILog[]; protected pid: number; protected debugLog: DebugLog; protected spdLogLoggerPromise: Promise | undefined; protected logDir: string; protected logLevel: LogLevel; constructor(options: BaseLogServiceOptions); protected init(options: BaseLogServiceOptions): void; verbose(): void; debug(): void; log(): void; warn(): void; error(): void; critical(): void; getLevel(): LogLevel; setLevel(level: LogLevel): void; sendLog(level: LogLevel, message: string): void; drop(): Promise; flush(): Promise; dispose(): void; protected disposeLogger(): void; protected createSpdLogLoggerPromise(namespace: string, logsFolder: string): Promise; /** * 日志行格式 `[年-月-日 时:分:秒:毫秒][级别][PID]` 比如: * [2019-08-15 14:32:19.207][INFO][50715] log message!!! * [年-月-日 时:分:秒:毫秒] 由 spdlog 提供 */ protected applyLogPreString(message: string, level: any): string; protected doLog(logger: SpdLogger, level: LogLevel, message: string): void; protected showDebugLog(level: LogLevel, message: string): void; } export declare class LogService extends BaseLogService implements ILogService { protected logServiceManager: ILogServiceManager; constructor(options: ILogServiceOptions); protected init(options: ILogServiceOptions): void; setOptions(options: BaseLogServiceOptions): void; getLevel(): LogLevel; setLevel(level: LogLevel): void; dispose(): void; } interface IRPCLogService { onDidLogLevelChanged(level: LogLevel): void; } export declare class LogServiceForClient extends RPCService implements ILogServiceForClient { loggerManager: ILogServiceManager; constructor(); getLevel(namespace: SupportLogNamespace): LogLevel; setLevel(namespace: SupportLogNamespace, level: LogLevel): void; verbose(namespace: SupportLogNamespace, message: string, pid?: number): void; debug(namespace: SupportLogNamespace, message: string, pid?: number): void; log(namespace: SupportLogNamespace, message: string, pid?: number): void; warn(namespace: SupportLogNamespace, message: string, pid?: number): void; error(namespace: SupportLogNamespace, message: string, pid?: number): void; critical(namespace: SupportLogNamespace, message: string, pid?: number): void; disposeLogger(namespace: SupportLogNamespace): Promise; setGlobalLogLevel(level: LogLevel): Promise; getGlobalLogLevel(): Promise; disposeAll(): Promise; getLogFolder(): Promise; protected getLogger(namespace: SupportLogNamespace, options?: BaseLogServiceOptions): ILogService; } export {}; //# sourceMappingURL=log.service.d.ts.map