const bunyan = require("bunyan")

const host = require("os").hostname()
const merge = require("merge-recursive")

function Logger(config) {
  return function logger(opt) {
    if (typeof opt != "object") opt = {
      name: opt
    }
    opt = merge(opt, config)
    opt.name = "zeronet:" + opt.name
    if (process.env.LOGGER_NAME) opt.hostname = process.env.LOGGER_NAME + "@" + host
    let log = bunyan.createLogger(opt)
    let self = log.info.bind(log)
    self.logger = log
    log.level(0)

    function ccb(type) {
      self[type] = log[type].bind(log)
    }

    ccb("info")
    self.log = self.info
    ccb("warn")
    ccb("error")
    ccb("debug")
    ccb("trace")
    ccb("fatal")
    return self
  }
}
module.exports = Logger

@@ -505,18 +505,29 @@
 nction c
-cb
+reateFunction
 (type) %7B
@@ -578,18 +578,29 @@
 %7D%0A%0A    c
-cb
+reateFunction
 (%22info%22)
@@ -630,18 +630,29 @@
 fo%0A    c
-cb
+reateFunction
 (%22warn%22)
@@ -657,18 +657,29 @@
 %22)%0A    c
-cb
+reateFunction
 (%22error%22
@@ -685,18 +685,29 @@
 %22)%0A    c
-cb
+reateFunction
 (%22debug%22
@@ -713,18 +713,29 @@
 %22)%0A    c
-cb
+reateFunction
 (%22trace%22
@@ -745,10 +745,21 @@
    c
-cb
+reateFunction
 (%22fa

Rename some vars