Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
feat: export bunyan so users can create their own loggers from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
jshimko committed Apr 2, 2018
1 parent 9f6f43c commit 29f4f3c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bunyan from "bunyan";
import bunyanFormat from "bunyan-format";
import Bunyan from "bunyan";
import BunyanFormat from "bunyan-format";
import Bunyan2Loggly from "./loggly";


Expand All @@ -24,7 +24,7 @@ if (!levels.includes(level)) {
// default console config (stdout)
const streams = [{
level,
stream: bunyanFormat({ outputMode })
stream: BunyanFormat({ outputMode })
}];

// Loggly config (only used if configured)
Expand All @@ -44,9 +44,13 @@ if (logglyToken && logglySubdomain) {
}

// create default logger instance
const Logger = bunyan.createLogger({
const Logger = Bunyan.createLogger({
name: process.env.REACTION_LOGGER_NAME || "Reaction",
streams
});

// export bunyan so users can create their own loggers from scratch if needed
export { default as bunyan } from "bunyan";
export { default as bunyanFormat } from "bunyan-format";

export default Logger;

0 comments on commit 29f4f3c

Please sign in to comment.