villadora / express-bunyan-logger

bunyan logger middleware for express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clearer error message if you use the library incorrectly

kevinburke opened this issue · comments

I was incorrectly doing

var bunyanLogger = require("express-bunyan-logger");
var express = require("express");
var app = express();
app.use(bunyanLogger);

when I really wanted:

app.use(bunyanLogger());

It's hard to tell what goes wrong in the first case. The app just hangs and never hits the callback. It would be nice if this library detected if opts was actually an http.IncomingMessage and returned an appropriate error.