improve logging

This commit is contained in:
les
2021-04-28 12:44:26 +02:00
parent f7ba790398
commit 5f8bbd68c8
16 changed files with 63 additions and 39 deletions

View File

@@ -61,7 +61,7 @@ const settingsController = {
// add pub/priv instance key if needed
if (!settingsController.settings.publicKey) {
log.debug('Instance priv/pub key not found')
log.info('Instance priv/pub key not found, generating....')
const { publicKey, privateKey } = await generateKeyPair('rsa', {
modulusLength: 4096,
publicKeyEncoding: {
@@ -92,7 +92,7 @@ const settingsController = {
},
async set (key, value, is_secret = false) {
log.debug(`SET ${key} ${value}`)
log.info(`SET ${key} ${value}`)
try {
const [setting, created] = await Setting.findOrCreate({
where: { key },
@@ -115,7 +115,8 @@ const settingsController = {
setLogo (req, res) {
if (!req.file) {
return res.status(400).send('Mmmmm sould not be here!')
settingsController.set('logo', false)
return res.status(200)
}
const uploadedPath = path.join(req.file.destination, req.file.filename)