Separate the logging #27

Open
lecris wants to merge 6 commits from lecris/matrix-puppeteer-line:logger into testing
2 changed files with 3 additions and 2 deletions
Showing only changes of commit a477d10d29 - Show all commits

View File

@ -16,6 +16,7 @@
import net from "net"
import fs from "fs"
import path from "path"
import logger from "loglevel";
import Client from "./client.js"
import { promisify } from "./util.js"
@ -29,7 +30,7 @@ export default class PuppetAPI {
this.clients = new Map()
this.connIDSequence = 0
this.stopped = false
this.log = require("loglevel").getLogger("API")
this.log = logger.getLogger("API")
}
acceptConnection = sock => {

View File

@ -35,7 +35,7 @@ export default class Client {
this.maxCommandID = 0
this.set_userID(userID)
if (!this.userID) {
this.log = require("loglevel").getLogger(`API/${this.connID}`)
this.log = logger.getLogger(`API/${this.connID}`)
this.log.setLevel(logger.getLogger("API").getLevel())
}
}