mirror of
https://github.com/exchanges-lab/view.git
synced 2026-08-08 06:24:43 +08:00
Upload files.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* If you want to enable logs from datafeed set it to `true`
|
||||
*/
|
||||
const isLoggingEnabled = false;
|
||||
export function logMessage(message) {
|
||||
if (isLoggingEnabled) {
|
||||
const now = new Date();
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log(`${now.toLocaleTimeString()}.${now.getMilliseconds()}> ${message}`);
|
||||
}
|
||||
}
|
||||
export function getErrorMessage(error) {
|
||||
if (error === undefined) {
|
||||
return '';
|
||||
}
|
||||
else if (typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
return error.message;
|
||||
}
|
||||
Reference in New Issue
Block a user