mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
reducing logging in production
This commit is contained in:
parent
fca431799f
commit
805e12c792
@ -10,7 +10,7 @@ declare module 'winston' {
|
|||||||
export const winstonSettings = {
|
export const winstonSettings = {
|
||||||
transports: [
|
transports: [
|
||||||
new winston.transports.Console({
|
new winston.transports.Console({
|
||||||
level: 'silly',
|
level: process.env.NODE_ENV == "production" ? "info" : 'silly',
|
||||||
handleExceptions: true,
|
handleExceptions: true,
|
||||||
json: false,
|
json: false,
|
||||||
colorize: true,
|
colorize: true,
|
||||||
|
@ -56,8 +56,6 @@ export class UserManager implements IUserManager {
|
|||||||
delete filter.password;
|
delete filter.password;
|
||||||
const users = (await this.db.get("users")).slice();
|
const users = (await this.db.get("users")).slice();
|
||||||
let i = users.length;
|
let i = users.length;
|
||||||
console.log("filer", filter);
|
|
||||||
console.log(users);
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
if (pass && !(PasswordHelper.comparePassword(pass, users[i].password))) {
|
if (pass && !(PasswordHelper.comparePassword(pass, users[i].password))) {
|
||||||
users.splice(i, 1);
|
users.splice(i, 1);
|
||||||
|
@ -25,7 +25,7 @@ export class Server {
|
|||||||
private server: any;
|
private server: any;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (process.env.DEBUG) {
|
if (!(process.env.NODE_ENV == "production")) {
|
||||||
Logger.debug(LOG_TAG, "Running in DEBUG mode");
|
Logger.debug(LOG_TAG, "Running in DEBUG mode");
|
||||||
}
|
}
|
||||||
this.init();
|
this.init();
|
||||||
|
Loading…
Reference in New Issue
Block a user