import { ILogger, RotationStrategy } from './domain'; import { MessengerServer } from 'pandora-messenger'; export declare class LoggerRotator { protected logger: ILogger; protected messengerServer: MessengerServer; protected strategyMap: Map; protected strategyHeartbeat: Map; protected timerClearances: { clear(): void; }[]; protected heartbeatCheckTime: number; protected heartbeatTimeMax: number; constructor(options?: { logger?: ILogger; heartbeatCheckTime?: number; heartbeatTimeMax?: number; }); /** * Start logger rotator service * @return {Promise} */ startService(): Promise; /** * Receive a log rotator strategy * @param {RotationStrategy} strategy */ receiveStrategy(strategy: RotationStrategy): void; /** * Reentry while */ protected start(): void; /** * start heartbeat while * @return {Promise} */ protected startHeartbeatWhile(): Promise; /** * Start fileSize cutting while * @return {Promise} */ protected startLogRotateBySize(): Promise; /** * Start date cutting while * @return {Promise} */ protected startLogRotateByDateTimer(): Promise; /** * Cut log file by date * @return {Promise} */ protected rotateLogByDate(): Promise; /** * Rename log file, put date as affix * @param {string} logfile * @return {Promise} */ protected renameLogfile(logfile: string): Promise; /** * A cycle to find out which log file needs to cut * @return {Promise} */ protected rotateLogBySize(): Promise; /** * Cut log file by size * @param {RotationStrategy} strategy * @return {Promise} */ protected rotateBySize(strategy: RotationStrategy): Promise; /** * If file exist, try backup. If backup filed, remove it. * This operation for the file size cutting only. * @param targetPath * @param backupPath * @return {Promise} */ protected renameOrDelete(targetPath: any, backupPath: any): Promise; /** * Calculate interval time for rotate log by size * @return {number} */ protected caclIntervalForRotateLogBySize(): number; /** * Broadcast reload message to all client * @param {string} uuid */ protected broadcastReload(uuid?: string): void; /** * Produce a delay on an optimistic lock, optimistic lock can broke this delay * @param ms * @return {Promise} */ protected delayOnOptimisticLock(ms: any): Promise; /** * Get unique strategies list * @return {RotationStrategy[]} */ protected getFilteredStrategiesList(): RotationStrategy[]; /** * Get all the strategies of the rotate by date * @return {RotationStrategy[]} */ protected getStrategiesRotateByDate(): RotationStrategy[]; /** * Get all the strategies of the rotate by size * @return {RotationStrategy[]} */ protected getStrategiesRotateBySize(): RotationStrategy[]; /** * Remove a strategy without restart * @param uuid */ protected removeStrategyWithoutRestart(uuid: any): void; }