Skip to main content
Module

x/yaml/src/log.ts

JavaScript parser and stringifier for YAML
Go to Latest
File
export type LogLevelId = 'silent' | 'error' | 'warn' | 'debug'
export function debug(logLevel: LogLevelId, ...messages: any[]) { if (logLevel === 'debug') console.log(...messages)}
export function warn(logLevel: LogLevelId, warning: string | Error) { if (logLevel === 'debug' || logLevel === 'warn') { if (typeof process !== 'undefined' && process.emitWarning) process.emitWarning(warning) else console.warn(warning) }}