@kcutils/logger
Version:
Another Logger Service
58 lines • 2.19 kB
TypeScript
/**
* @packageDocumentation
* @module Logger.Builders
*/
/// <reference types="node" />
import { Writable } from "stream";
import { OptionalOption, OutputType, DateTimeFormat, LoggerOption } from "../models/logger/LoggerOption";
import { Levels } from "../constants/levels";
import { LoggerTypeBuilder } from "./LoggerTypeBuilder";
import { LoggerSettingBuilder } from "./LoggerSettingBuilder";
import { Types } from "../models/logger/LoggerType";
import { StrictSetting } from "../models/logger/LoggerSetting";
export declare class LoggerOptionBuilder<T extends string> {
static initial<T extends string = "">(): LoggerOptionBuilder<T>;
static load<T extends string = "">(option: OptionalOption): LoggerOptionBuilder<T>;
private debug;
private output;
private json;
private interactive;
private disabled;
private color;
private level;
private datetime;
private censor;
private separator;
private scopes;
private secrets;
private overrideStream;
private streams;
private types?;
private settings?;
constructor();
withDebug(toggle?: boolean): this;
withJson(toggle?: boolean): this;
withInteractive(toggle?: boolean): this;
withDisabled(toggle?: boolean): this;
withColor(toggle?: boolean): this;
withoutColor(): this;
withLevel(level: Levels): this;
withDatetime(type: DateTimeFormat): this;
withCensor(censor: (input: string) => string): this;
withSeparator(separator: string): this;
withScopes(scopes: string[]): this;
withSecrets(secrets: string[]): this;
withOverrideStream(streams: Writable[]): this;
withoutOverrideStream(): this;
withOutput(output: OutputType[]): this;
withType<R extends string>(name: R, builder: LoggerTypeBuilder): LoggerOptionBuilder<T | R>;
withRawType<N extends string>(types: Types<N>): LoggerOptionBuilder<N>;
withSetting<R extends keyof StrictSetting>(name: R, builder: LoggerSettingBuilder): this;
withRawSetting(settings: StrictSetting): this;
/**
* always create new object
*/
get(): LoggerOption<T>;
private internalGet;
}
//# sourceMappingURL=LoggerOptionBuilder.d.ts.map