@uppy/core
Version:
Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:
24 lines (20 loc) • 746 B
text/typescript
import { getTimeStamp } from '@uppy/utils'
// Swallow all logs, except errors.
// default if logger is not set or debug: false
const justErrorsLogger = {
debug: (): void => {},
warn: (): void => {},
error: (...args: any[]): void =>
console.error(`[Uppy] [${getTimeStamp()}]`, ...args),
}
// Print logs to console with namespace + timestamp,
// set by logger: Uppy.debugLogger or debug: true
const debugLogger = {
debug: (...args: any[]): void =>
console.debug(`[Uppy] [${getTimeStamp()}]`, ...args),
warn: (...args: any[]): void =>
console.warn(`[Uppy] [${getTimeStamp()}]`, ...args),
error: (...args: any[]): void =>
console.error(`[Uppy] [${getTimeStamp()}]`, ...args),
}
export { justErrorsLogger, debugLogger }