chore(misc): normalize logs (#242)

This commit is contained in:
Jef LeCompte
2020-09-23 14:20:06 -04:00
committed by GitHub
parent 8466f9f398
commit 7c50e2b5aa
21 changed files with 239 additions and 183 deletions
+16
View File
@@ -1,3 +1,4 @@
import {Link, Store} from './store/model';
import winston, {format} from 'winston';
import {Config} from './config';
@@ -22,3 +23,18 @@ export const Logger = winston.createLogger({
level: Config.logLevel,
transports: [new winston.transports.Console({})]
});
export const Print = {
captcha(link: Link, store: Store): string {
return `✖ [${store.name}] [${link.brand} (${link.series})] ${link.model} :: CAPTCHA`;
},
inStock(link: Link, store: Store): string {
return `🚀🚨 [${store.name}] [${link.brand} (${link.series})] ${link.model} :: IN STOCK 🚨🚀`;
},
outOfStock(link: Link, store: Store): string {
return `✖ [${store.name}] [${link.brand} (${link.series})] ${link.model} :: OUT OF STOCK`;
},
rateLimit(link: Link, store: Store): string {
return `✖ [${store.name}] [${link.brand} (${link.series})] ${link.model} :: RATE LIMIT EXCEEDED`;
}
};