Skip to main content
Deno 2 is finally here 🎉️
Learn more
class AbstractWinstonLogger
implements ILogger
Abstract
import { AbstractWinstonLogger } from "https://deno.land/x/sptaki@1.2.0/utils/logging/AbstractWinstonLogger.d.ts";

Constructors

new
AbstractWinstonLogger(asyncQueue: IAsyncQueue)

Properties

protected
asyncQueue: IAsyncQueue
protected
filePath: string
protected
logger: winston.Logger & SptLogger
protected
logLevels: { levels: { error: number; warn: number; succ: number; info: number; custom: number; debug: number; }; colors: { error: string; warn: string; succ: string; info: string; custom: string; debug: string; }; bgColors: { default: string; blackBG: string; redBG: string; greenBG: string; yellowBG: string; blueBG: string; magentaBG: string; cyanBG: string; whiteBG: string; }; }
protected
showDebugInConsole: boolean
protected
writeFilePromisify: (
path: fs.PathLike,
data: string,
options?: any,
) => Promise<void>

Methods

protected
abstract
getFileName(): string
protected
abstract
getFilePath(): string
protected
getLogFrequency(): string
protected
getLogMaxFiles(): string
protected
getLogMaxSize(): string
protected
abstract
isLogExceptions(): boolean
protected
abstract
isLogToConsole(): boolean
protected
abstract
isLogToFile(): boolean
debug(data: string | Record<string, unknown>, onlyShowInConsole?: boolean): Promise<void>
error(data: string | Record<string, unknown>): Promise<void>
info(data: string | Record<string, unknown>): Promise<void>
log(
data: string | Error | Record<string, unknown>,
color: string,
backgroundColor?: string,
): Promise<void>
logWithColor(
data: string | Record<string, unknown>,
textColor: LogTextColor,
backgroundColor?: LogBackgroundColor,
): Promise<void>

Log to console text with a customisable text and background color. Background defaults to black

success(data: string | Record<string, unknown>): Promise<void>
warning(data: string | Record<string, unknown>): Promise<void>
writeToLogFile(data: string | Daum): Promise<void>