support adding to spotify playlist
This commit is contained in:
@ -33,3 +33,54 @@ export const log = {
|
||||
return DEV;
|
||||
}
|
||||
};
|
||||
|
||||
export class Logger {
|
||||
public constructor(private name: string) {}
|
||||
|
||||
public static isDebugEnabled(): boolean {
|
||||
return DEV;
|
||||
}
|
||||
public verbose(...params: any[]) {
|
||||
if (!enableVerboseLog) {
|
||||
return;
|
||||
}
|
||||
console.debug(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
public debug(...params: any[]) {
|
||||
if (!Logger.isDebugEnabled()) {
|
||||
return;
|
||||
}
|
||||
console.debug(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
public log(...params: any[]) {
|
||||
console.log(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
public info(...params: any[]) {
|
||||
console.info(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
public warn(...params: any[]) {
|
||||
console.warn(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
public error(...params: any[]) {
|
||||
console.error(new Date().toISOString(), `- ${this.name} -`, ...params);
|
||||
}
|
||||
|
||||
public static error(...params: any[]) {
|
||||
console.error(new Date().toISOString(), ...params);
|
||||
}
|
||||
public static debug(...params: any[]) {
|
||||
if (!Logger.isDebugEnabled()) {
|
||||
return;
|
||||
}
|
||||
console.debug(new Date().toISOString(), ...params);
|
||||
}
|
||||
public static log(...params: any[]) {
|
||||
console.log(new Date().toISOString(), ...params);
|
||||
}
|
||||
public static info(...params: any[]) {
|
||||
console.info(new Date().toISOString(), ...params);
|
||||
}
|
||||
public static warn(...params: any[]) {
|
||||
console.warn(new Date().toISOString(), ...params);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user