Disable pug debug output with express.js web app

While developing an express app and using pug, as long as NODE_ENV !== 'production' pug outputs function bodies to stdout. I find that pretty annoying, and I only want it to output stuff to console when theres actually an error.

Can be done by setting a custom engine function for pug

app.engine('pug', (path, options, fn) => {
  options.debug = false
  return pug.__express.call(null, path, options, fn)
app.set('view engine', 'pug')


If you have any comments or feedback, please send me an e-mail. (stig at stigok dotcom)