From 431aa0192d8874d954951a322b152c410de02f6f Mon Sep 17 00:00:00 2001 From: Shane Duan Date: Sun, 25 Nov 2018 01:02:56 -0800 Subject: [PATCH] Allow choice of logging verbosity --- config/default-example.yaml | 3 +++ src/utils.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/config/default-example.yaml b/config/default-example.yaml index 46d0b1d..f55912a 100644 --- a/config/default-example.yaml +++ b/config/default-example.yaml @@ -21,6 +21,9 @@ database: db.sqlite # which directory to keep x2i keys (sub dirs.data) x2i: x2i +# logging level; see npmlog.level +level: info + # embed options (ie the fancy posts only bots can do) # they mess with e-readers and logging apparently so you might want to turn it # off if that's a thing you need to worry about diff --git a/src/utils.ts b/src/utils.ts index a7c6dd5..17bb35d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -16,6 +16,7 @@ npmlog.style = new Proxy(npmlog.style, { get: (o, k) => o[k] || o.info, }); npmlog.enableColor(); +npmlog.level = c.has("level") ? c.get("level") : "info"; function splitPrefix(status: string): [string, string] { const sepIndex = status.indexOf(":");