Make debug logging controllable by config.
This commit is contained in:
@@ -166,14 +166,6 @@ export function getDurationString(start: Date, end: Date): string {
|
||||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* For debug purposes only.
|
||||
* @param seconds
|
||||
*/
|
||||
export const sleep = async (seconds: number) => {
|
||||
await new Promise((r) => setTimeout(r, seconds * 1000));
|
||||
};
|
||||
|
||||
export const allPromises = async <T>(
|
||||
items: T[],
|
||||
func: (arg: T) => void,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { CardWideConfig } from '../types';
|
||||
|
||||
export const log = (cardWideConfig?: CardWideConfig, ...args: unknown[]) => {
|
||||
if (cardWideConfig?.debug?.logging) {
|
||||
console.debug(...args);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* For debug purposes only.
|
||||
* @param seconds
|
||||
*/
|
||||
export const sleep = async (seconds: number) => {
|
||||
await new Promise((r) => setTimeout(r, seconds * 1000));
|
||||
};
|
||||
Reference in New Issue
Block a user