mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
fix: re-enable logging only for dev mode
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const { generateKeyPairSync } = require('crypto');
|
||||
const process = require('process');
|
||||
const nconf = require('nconf');
|
||||
const winston = require('winston');
|
||||
const validator = require('validator');
|
||||
const cheerio = require('cheerio');
|
||||
const crypto = require('crypto');
|
||||
@@ -25,6 +27,12 @@ const sha256 = payload => crypto.createHash('sha256').update(payload).digest('he
|
||||
|
||||
const Helpers = module.exports;
|
||||
|
||||
Helpers.log = (message) => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
winston.verbose(message);
|
||||
}
|
||||
};
|
||||
|
||||
Helpers.isUri = (value) => {
|
||||
if (typeof value !== 'string') {
|
||||
value = String(value);
|
||||
@@ -106,7 +114,7 @@ Helpers.query = async (id) => {
|
||||
};
|
||||
|
||||
Helpers.generateKeys = async (type, id) => {
|
||||
// winston.verbose(`[activitypub] Generating RSA key-pair for ${type} ${id}`);
|
||||
activitypub.helpers.log(`[activitypub] Generating RSA key-pair for ${type} ${id}`);
|
||||
const {
|
||||
publicKey,
|
||||
privateKey,
|
||||
|
||||
Reference in New Issue
Block a user