@seagull/logging
Version:
Logging utilities for the Seagull Framework
21 lines (15 loc) • 447 B
text/typescript
import * as log from 'npmlog'
import { Stash } from './stash'
const stash = new Stash()
if (process.env.STAGE === 'test') {
;(log as any).stream = stash
}
export function messages() {
return stash.buffer
}
export function info(source: string, message: string, ...args: any[]) {
log.info(`[${source}]`, message, args)
}
export function error(source: string, message: string, ...args: any[]) {
log.error(`[${source}]`, message, args)
}