mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
chore: refactor config and fix audits (#406)
This commit is contained in:
+5
-5
@@ -1,7 +1,7 @@
|
||||
import {Link, Store} from './store/model';
|
||||
import winston, {format} from 'winston';
|
||||
import {Config} from './config';
|
||||
import chalk from 'chalk';
|
||||
import {config} from './config';
|
||||
|
||||
const prettyJson = format.printf(info => {
|
||||
const timestamp = new Date().toLocaleTimeString();
|
||||
@@ -13,7 +13,7 @@ const prettyJson = format.printf(info => {
|
||||
return chalk.grey(`[${timestamp}]`) + ` ${info.level} ` + chalk.grey('::') + ` ${info.message}`;
|
||||
});
|
||||
|
||||
export const Logger = winston.createLogger({
|
||||
export const logger = winston.createLogger({
|
||||
format: format.combine(
|
||||
format.colorize(),
|
||||
format.prettyPrint(),
|
||||
@@ -21,7 +21,7 @@ export const Logger = winston.createLogger({
|
||||
format.simple(),
|
||||
prettyJson
|
||||
),
|
||||
level: Config.logLevel,
|
||||
level: config.logLevel,
|
||||
transports: [new winston.transports.Console({})]
|
||||
});
|
||||
|
||||
@@ -76,10 +76,10 @@ export const Print = {
|
||||
},
|
||||
maxPrice(link: Link, store: Store, price: number, color?: boolean): string {
|
||||
if (color) {
|
||||
return '✖ ' + buildProductString(link, store, true) + ' :: ' + chalk.yellow(`PRICE ${price} EXCEEDS LIMIT ${Config.store.maxPrice}`);
|
||||
return '✖ ' + buildProductString(link, store, true) + ' :: ' + chalk.yellow(`PRICE ${price} EXCEEDS LIMIT ${config.store.maxPrice}`);
|
||||
}
|
||||
|
||||
return `✖ ${buildProductString(link, store)} :: PRICE ${price} EXCEEDS LIMIT ${Config.store.maxPrice}`;
|
||||
return `✖ ${buildProductString(link, store)} :: PRICE ${price} EXCEEDS LIMIT ${config.store.maxPrice}`;
|
||||
},
|
||||
message(message: string, topic: string, store: Store, color?: boolean): string {
|
||||
if (color) {
|
||||
|
||||
Reference in New Issue
Block a user