code optimisation

This commit is contained in:
2022-06-09 11:48:05 +02:00
parent 47e2a1f27c
commit 25dee4921b
9 changed files with 41 additions and 21 deletions

View File

@@ -4,9 +4,22 @@ const ansi = {
cyan: '\u001b[36m',
green: '\u001b[32m',
yellow: '\u001b[93m',
bold: '\u001b[1m',
normal: '\u001b[22m',
}
class Logger {
private static _instance: Logger;
constructor() { };
static get instance() {
if (this._instance) {
return this._instance
}
this._instance = new Logger()
return this._instance;
}
/**
* Print a standard info message
* @param {string} proto the context/protocol/section outputting the message
@@ -39,7 +52,7 @@ class Logger {
}
private formatter(proto: any, args: any) {
return `[${proto}]\t${args}\n`
return `${ansi.bold}[${proto}]${ansi.normal}\t${args}\n`
}
}

View File

@@ -11,8 +11,13 @@ export const logger = (proto: string, args: string) => {
/**
* CLI splash
*/
export const splash = () => {
console.log("-------------------------------------------------")
console.log("yt-dlp-webUI - A web-ui for yt-dlp, simply enough")
console.log("-------------------------------------------------")
console.log(" __ ____ __ __ ______")
console.log(" __ __/ /________/ / /__ _ _____ / / / / / / _/")
console.log(" / // / __/___/ _ / / _ \ | |/|/ / -_) _ \/ /_/ // / ")
console.log(" \_, /\__/ \_,_/_/ .__/ |__,__/\__/_.__/\____/___/ ")
console.log("/___/ /_/ \n")
console.log(" yt-dlp-webUI - A web-ui for yt-dlp, simply enough")
console.log("---------------------------------------------------\n")
}