logger icon indicating copy to clipboard operation
logger copied to clipboard

Option to disable colors in log output

Open jamiemjennings opened this issue 6 years ago • 2 comments

Our use case for koa-logger doesn't allow for color codes in the output. We're currently using the strip-ansi module to strip those out, however it would be preferable if we could simply disable colored output in the logger options.

ie, something like this:

const logger = require('koa-logger')
const Koa = require('koa')

const app = new Koa()
var loggerTransport = function () { ... }
var loggerConfig = { colorOutput: false }
app.use(logger(loggerTransport, loggerConfig))

Has this been considered? It seems like it would be fairly straightforward to implement. I can submit a PR if the maintainers are open to the idea.

jamiemjennings avatar Jun 06 '18 15:06 jamiemjennings

PR welcome :)

haoxins avatar Jun 13 '18 02:06 haoxins

Any updated on this?

AntonisFK avatar Mar 03 '20 22:03 AntonisFK