Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Quiñones committed Jul 6, 2018
1 parent 4009232 commit 57b66dd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
46 changes: 23 additions & 23 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

## ClientLogger

[src/client.js:80-86](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/client.js#L80-L86 "Source code on GitHub")
[src/client.js:80-86](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/client.js#L80-L86 "Source code on GitHub")

A logger than can be used in browsers

Expand All @@ -40,13 +40,13 @@ A logger than can be used in browsers

## ClientConsoleLogger

[src/util/client/consoleLogger.js:9-9](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/consoleLogger.js#L9-L9 "Source code on GitHub")
[src/util/client/consoleLogger.js:9-9](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/consoleLogger.js#L9-L9 "Source code on GitHub")

Pretty logging to `console` for client applications

### write

[src/util/client/consoleLogger.js:16-48](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/consoleLogger.js#L16-L48 "Source code on GitHub")
[src/util/client/consoleLogger.js:16-48](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/consoleLogger.js#L16-L48 "Source code on GitHub")

Transport to `console`

Expand All @@ -58,7 +58,7 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re

## ClientLogentriesLogger

[src/util/client/logentriesLogger.js:10-23](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/logentriesLogger.js#L10-L23 "Source code on GitHub")
[src/util/client/logentriesLogger.js:10-23](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/logentriesLogger.js#L10-L23 "Source code on GitHub")

Custom bunyan stream that transports to Logentries from client applications

Expand All @@ -70,7 +70,7 @@ Custom bunyan stream that transports to Logentries from client applications

### write

[src/util/client/logentriesLogger.js:30-37](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/logentriesLogger.js#L30-L37 "Source code on GitHub")
[src/util/client/logentriesLogger.js:30-37](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/logentriesLogger.js#L30-L37 "Source code on GitHub")

Transport logs to Logentries

Expand All @@ -82,7 +82,7 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re

## ClientRollbarLogger

[src/util/client/rollbarLogger.js:21-37](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/rollbarLogger.js#L21-L37 "Source code on GitHub")
[src/util/client/rollbarLogger.js:21-37](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/rollbarLogger.js#L21-L37 "Source code on GitHub")

Custom rollbar stream that transports to logentries from a browser
Wortks with a global Rollbar instance that is already initialized.
Expand All @@ -99,7 +99,7 @@ integrating Rollbar in client apps

### write

[src/util/client/rollbarLogger.js:44-56](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/rollbarLogger.js#L44-L56 "Source code on GitHub")
[src/util/client/rollbarLogger.js:44-56](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/client/rollbarLogger.js#L44-L56 "Source code on GitHub")

Transport logs to Rollbar

Expand All @@ -111,7 +111,7 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re

## NodeLogger

[src/node.js:68-82](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/node.js#L68-L82 "Source code on GitHub")
[src/node.js:68-82](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/node.js#L68-L82 "Source code on GitHub")

A logger than can be used in node processes

Expand All @@ -123,33 +123,33 @@ A logger than can be used in node processes

## BUNYAN_CONFIG_FIELDS

[src/util/common/config.js:9-14](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L9-L14 "Source code on GitHub")
[src/util/common/config.js:9-14](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L9-L14 "Source code on GitHub")

Config keys that should always be passed to
`bunyan.createLogger`

## DEFAULT_ROOT_FIELDS

[src/util/common/config.js:22-25](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L22-L25 "Source code on GitHub")
[src/util/common/config.js:22-26](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L22-L26 "Source code on GitHub")

Whitelist of extra config keys that should be
passed to `bunyan.createLogger` to form
root logger fields.

## BUNYAN_LOGGER_LEVELS

[src/util/common/config.js:32-32](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L32-L32 "Source code on GitHub")
[src/util/common/config.js:33-33](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L33-L33 "Source code on GitHub")

Array of bunyan's different log levels.
<https://github.com/trentm/node-bunyan#levels>

## DEFAULT_CONFIG

[src/util/common/config.js:35-47](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L35-L47 "Source code on GitHub")
[src/util/common/config.js:36-48](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L36-L48 "Source code on GitHub")

## assembleConfig

[src/util/common/config.js:60-67](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L60-L67 "Source code on GitHub")
[src/util/common/config.js:61-68](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L61-L68 "Source code on GitHub")

Merges config with DEFAULT_CONFIG, and appends passed in streams
with pre-configured streams for the runtime.
Expand All @@ -166,7 +166,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

## toBunyanConfig

[src/util/common/config.js:78-80](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/config.js#L78-L80 "Source code on GitHub")
[src/util/common/config.js:79-81](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/config.js#L79-L81 "Source code on GitHub")

Create a config objct for bunyan from a full `we-js-logger` config object.
Extra keys passed to `bunyan.createLogger` become root logger fields, pass
Expand All @@ -181,7 +181,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

## logForLevel

[src/util/common/logForLevel.js:10-22](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/logForLevel.js#L10-L22 "Source code on GitHub")
[src/util/common/logForLevel.js:10-22](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/logForLevel.js#L10-L22 "Source code on GitHub")

Creates a log method for a particular level

Expand All @@ -193,7 +193,7 @@ Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Ref

## logIt

[src/util/common/logForLevel.js:19-21](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/logForLevel.js#L19-L21 "Source code on GitHub")
[src/util/common/logForLevel.js:19-21](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/logForLevel.js#L19-L21 "Source code on GitHub")

Log at a level.
Must be bound to a logger instance.
Expand All @@ -206,7 +206,7 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re

## ServerRollbarLogger

[src/util/server/rollbarLogger.js:12-21](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/rollbarLogger.js#L12-L21 "Source code on GitHub")
[src/util/server/rollbarLogger.js:12-21](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/server/rollbarLogger.js#L12-L21 "Source code on GitHub")

Custom bunyan stream that transports to Rollbar from a node process.
See <https://rollbar.com/docs/notifier/node_rollbar/> for integration details
Expand All @@ -220,7 +220,7 @@ See <https://rollbar.com/docs/notifier/node_rollbar/> for integration details

### write

[src/util/server/rollbarLogger.js:31-44](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/rollbarLogger.js#L31-L44 "Source code on GitHub")
[src/util/server/rollbarLogger.js:31-44](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/server/rollbarLogger.js#L31-L44 "Source code on GitHub")

handles `err` and `req` properties, attaches any custom data,
and calls the appropriate Rollbar method.
Expand All @@ -233,15 +233,15 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re

## bunyanToRollbarLevelMap

[src/util/common/rollbar.js:11-18](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/rollbar.js#L11-L18 "Source code on GitHub")
[src/util/common/rollbar.js:11-18](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/rollbar.js#L11-L18 "Source code on GitHub")

Map of bunyan log levels to Rollbar levels
<https://github.com/trentm/node-bunyan#levels>
<https://rollbar.com/docs/notifier/rollbar.js/api/#rollbardebuginfowarnwarningerrorcritical>

## bunyanLevelToRollbarLevelName

[src/util/common/rollbar.js:25-28](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/common/rollbar.js#L25-L28 "Source code on GitHub")
[src/util/common/rollbar.js:25-28](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/common/rollbar.js#L25-L28 "Source code on GitHub")

Convert bunyan log level to rollbar level. Defaults to 'error'.

Expand All @@ -253,7 +253,7 @@ Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

## ServerLogentriesLogger

[src/util/server/logentriesLogger.js:10-20](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/logentriesLogger.js#L10-L20 "Source code on GitHub")
[src/util/server/logentriesLogger.js:10-20](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/server/logentriesLogger.js#L10-L20 "Source code on GitHub")

Custom bunyan stream that transports to logentries from a node process

Expand All @@ -268,7 +268,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer

## createRequestLogger

[src/util/server/requestLogger.js:12-48](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/requestLogger.js#L12-L48 "Source code on GitHub")
[src/util/server/requestLogger.js:12-48](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/server/requestLogger.js#L12-L48 "Source code on GitHub")

Create a request loging express middleware

Expand All @@ -282,7 +282,7 @@ Returns **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Ref

## requestLoggerMiddleware

[src/util/server/requestLogger.js:24-47](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/requestLogger.js#L24-L47 "Source code on GitHub")
[src/util/server/requestLogger.js:24-47](https://github.com/wework/we-js-logger/blob/40092326eb67b7e4226500081ec51bc9e64b0277/src/util/server/requestLogger.js#L24-L47 "Source code on GitHub")

Request Logger Middleware
Adds base logging to every request
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

Generated by [auto-changelog](https://github.com/CookPete/auto-changelog).

#### [v2.0.2](https://github.com/wework/we-js-logger/compare/v2.0.1...v2.0.2)
> 6 July 2018
- Adds javascript to root fields of the logger [`#159`](https://github.com/wework/we-js-logger/pulls/159)

#### [v2.0.1](https://github.com/wework/we-js-logger/compare/v2.0.0...v2.0.1)
> 5 July 2018
- Exposes rollbar for the node logger [`#158`](https://github.com/wework/we-js-logger/pulls/158)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "we-js-logger",
"version": "2.0.1",
"version": "2.0.2",
"description": "A logger for Node and Browser JS with Rollbar and Logentries transports",
"author": "WeWork Digital <dev-team@wework.com>",
"contributors": [
Expand Down

0 comments on commit 57b66dd

Please sign in to comment.