UNPKG

@storm-software/config-tools

Version:

⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.

83 lines (80 loc) 2.97 kB
import { StormWorkspaceConfig } from '@storm-software/config'; import { LogLevel } from '../types.js'; import { getChalk } from './chalk.js'; /** * Get the log function for a log level * * @param logLevel - The log level * @param config - The Storm configuration * @returns The log function */ declare const getLogFn: (logLevel?: number | LogLevel, config?: Partial<StormWorkspaceConfig>, _chalk?: ReturnType<typeof getChalk>) => ((message?: any) => void); /** * Write a message to the console at the `fatal` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeFatal: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `error` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeError: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `warning` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeWarning: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `info` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeInfo: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `success` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeSuccess: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `debug` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeDebug: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `trace` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeTrace: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Write a message to the console at the `all` log level * * @param message - The message to write * @param config - The Storm configuration */ declare const writeSystem: (message?: any, config?: Partial<StormWorkspaceConfig>) => void; /** * Get a stopwatch function * * @param name - The name of the process * @returns The stopwatch function */ declare const getStopwatch: (name: string) => () => void; type FormatLogMessageOptions = { prefix?: string; skip?: string[]; }; declare const formatLogMessage: (message?: any, options?: FormatLogMessageOptions, depth?: number) => string; export { type FormatLogMessageOptions, formatLogMessage, getLogFn, getStopwatch, writeDebug, writeError, writeFatal, writeInfo, writeSuccess, writeSystem, writeTrace, writeWarning };