UNPKG

@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:

17 lines (16 loc) 681 B
import { getTimeStamp } from '@uppy/utils'; // Swallow all logs, except errors. // default if logger is not set or debug: false const justErrorsLogger = { debug: () => { }, warn: () => { }, error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args), }; // Print logs to console with namespace + timestamp, // set by logger: Uppy.debugLogger or debug: true const debugLogger = { debug: (...args) => console.debug(`[Uppy] [${getTimeStamp()}]`, ...args), warn: (...args) => console.warn(`[Uppy] [${getTimeStamp()}]`, ...args), error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args), }; export { justErrorsLogger, debugLogger };