koel/resources/assets/js/utils/logger.ts

9 lines
352 B
TypeScript
Raw Normal View History

2022-07-20 08:00:02 +00:00
const prefix = `[koel]`
export const logger = {
warn: (m, ...args: any[]) => process.env.NODE_ENV === 'development' && console.warn(prefix, m, ...args),
log: (m, ...args: any[]) => console.log(prefix, m, ...args),
error: (m, ...args: any[]) => console.error(prefix, m, ...args),
info: (m, ...args: any[]) => console.info(prefix, m, ...args)
}