Browse Source

remove logger - now in server

Kieran Gibb 2 years ago
parent
commit
8b5a562401
No known key found for this signature in database
2 changed files with 0 additions and 19 deletions
  1. 0
    6
      index.js
  2. 0
    13
      logger.js

+ 0
- 6
index.js View File

@@ -3,7 +3,6 @@ const fs = require('fs')
3 3
 const path = require('path')
4 4
 const os = require('os')
5 5
 const mkdirp = require('mkdirp')
6
-const logger = require('./logger')
7 6
 const crypto = require('cobox-crypto')
8 7
 const constants = require('cobox-constants')
9 8
 const { loadParentKey, saveParentKey } = require('./lib/keys')
@@ -24,9 +23,6 @@ const defaultConfig = (options = {}) => ({
24 23
   devices: { byKey: {}, byName: {} }
25 24
 })
26 25
 
27
-// filename-safe date (probably there is a better way to do this)
28
-const logfile = [new Date().toISOString().replace(/:/g, '-').replace(/\./, '-'), '.json'].join('')
29
-
30 26
 class CoBoxConfig {
31 27
   constructor (storage, opts = {}) {
32 28
     this.root = storage || constants.storage
@@ -52,8 +48,6 @@ class CoBoxConfig {
52 48
 
53 49
     this.deriveKeyPair = crypto.keyPair.bind(null, parentKey)
54 50
     this.identity = crypto.keyPair(parentKey, IDENTITY_SUBKEY_ID)
55
-    this.logger = logger(path.join(this.root, 'logs', logfile))
56
-    this.log = this.logger('cobox-config')
57 51
 
58 52
     this.groups = KeyHandler(this._groups)
59 53
     this.replicators = KeyHandler(this._replicators)

+ 0
- 13
logger.js View File

@@ -1,13 +0,0 @@
1
-const pino = require('pino')
2
-const Debug = require('debug')
3
-
4
-module.exports = function (storage, opts = {}) {
5
-  return function (name, suboptions = {}) {
6
-    if (!process.env.PRODUCTION) return Debug
7
-    const logger = pino({ name }, pino.destination(storage))
8
-    return function (...args) {
9
-      if (opts.stdout || suboptions.stdout) console.log(...args)
10
-      logger.info(...args)
11
-    }
12
-  }
13
-}