1.0.3 • Published 6 years ago

morgan-console v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Morgan Console

npm license

morgan wrapper that logs using console.info/console.error. For use in environments where the process.stdout/process.stderr don't work, e.g. Google Cloud Functions.

const express = require('express');
const morganConsole = require('morgan-console');

const app = express();
app.use(morganConsole('combined'));

Anything morgan would normally logged is logged to console.info/console.error in the combined format.

Installation

npm:

npm install morgan-console

Yarn:

yarn add morgan-console

Usage

morganConsole(format , morgan)

Create a new morgan-console middleware function using the given format and instance of morgan. If no instance of morgan is passed in then a default one will be created. Passing your own morgan instance in lets you register your own tokens with morgan before constructing the morgan-console middleware.

License

MIT

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago