mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 06:27:38 +00:00
chore(misc): normalize logs (#242)
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user