You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[src/client.js:80-86](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/client.js#L80-L86"Source code on GitHub")
31
+
[src/client.js:80-86](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/client.js#L80-L86"Source code on GitHub")
32
32
33
33
A logger than can be used in browsers
34
34
@@ -38,118 +38,60 @@ A logger than can be used in browsers
38
38
-`logger`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** an instance of a `bunyan` logger to use internally.
39
39
this is meant to be used by the `child` method.
40
40
41
-
## ClientConsoleLogger
42
-
43
-
[src/util/client/consoleLogger.js:9-9](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/consoleLogger.js#L9-L9"Source code on GitHub")
44
-
45
-
Pretty logging to `console` for client applications
46
-
47
-
### write
48
-
49
-
[src/util/client/consoleLogger.js:16-48](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/consoleLogger.js#L16-L48"Source code on GitHub")
[src/util/client/logentriesLogger.js:10-23](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/logentriesLogger.js#L10-L23"Source code on GitHub")
62
-
63
-
Custom bunyan stream that transports to Logentries from client applications
[src/util/client/logentriesLogger.js:30-37](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/logentriesLogger.js#L30-L37"Source code on GitHub")
43
+
[src/util/common/logForLevel.js:10-22](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/logForLevel.js#L10-L22"Source code on GitHub")
[src/util/client/rollbarLogger.js:21-37](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/rollbarLogger.js#L21-L37"Source code on GitHub")
86
-
87
-
Custom rollbar stream that transports to logentries from a browser
88
-
Wortks with a global Rollbar instance that is already initialized.
89
-
Note this expects rollbar to be loaded in the head, not via an npm module.
90
-
See <https://rollbar.com/docs/notifier/rollbar.js/#quick-start> for details on
[src/util/client/rollbarLogger.js:44-56](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/client/rollbarLogger.js#L44-L56"Source code on GitHub")
55
+
[src/util/common/logForLevel.js:19-21](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/logForLevel.js#L19-L21"Source code on GitHub")
-`logger`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** an instance of a `bunyan` logger to use internally.
122
-
this is meant to be used by the `child` method.
123
-
124
66
## BUNYAN_CONFIG_FIELDS
125
67
126
-
[src/util/common/config.js:9-14](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L9-L14"Source code on GitHub")
68
+
[src/util/common/config.js:9-14](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L9-L14"Source code on GitHub")
127
69
128
70
Config keys that should always be passed to
129
71
`bunyan.createLogger`
130
72
131
73
## DEFAULT_ROOT_FIELDS
132
74
133
-
[src/util/common/config.js:22-25](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L22-L25"Source code on GitHub")
75
+
[src/util/common/config.js:22-25](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L22-L25"Source code on GitHub")
134
76
135
77
Whitelist of extra config keys that should be
136
78
passed to `bunyan.createLogger` to form
137
79
root logger fields.
138
80
139
81
## BUNYAN_LOGGER_LEVELS
140
82
141
-
[src/util/common/config.js:32-32](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L32-L32"Source code on GitHub")
83
+
[src/util/common/config.js:32-32](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L32-L32"Source code on GitHub")
142
84
143
85
Array of bunyan's different log levels.
144
86
<https://github.com/trentm/node-bunyan#levels>
145
87
146
88
## DEFAULT_CONFIG
147
89
148
-
[src/util/common/config.js:35-47](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L35-L47"Source code on GitHub")
90
+
[src/util/common/config.js:35-47](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L35-L47"Source code on GitHub")
149
91
150
92
## assembleConfig
151
93
152
-
[src/util/common/config.js:60-67](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L60-L67"Source code on GitHub")
94
+
[src/util/common/config.js:60-67](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L60-L67"Source code on GitHub")
153
95
154
96
Merges config with DEFAULT_CONFIG, and appends passed in streams
[src/util/common/config.js:78-80](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/config.js#L78-L80"Source code on GitHub")
111
+
[src/util/common/config.js:78-80](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L78-L80"Source code on GitHub")
170
112
171
113
Create a config objct for bunyan from a full `we-js-logger` config object.
172
114
Extra keys passed to `bunyan.createLogger` become root logger fields, pass
@@ -179,51 +121,70 @@ a custom `config.rootFields` to control this behavior
179
121
180
122
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** config for bunyan.createLogger
181
123
182
-
## logForLevel
124
+
## ClientConsoleLogger
183
125
184
-
[src/util/common/logForLevel.js:10-22](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/logForLevel.js#L10-L22"Source code on GitHub")
126
+
[src/util/client/consoleLogger.js:9-9](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/consoleLogger.js#L9-L9"Source code on GitHub")
185
127
186
-
Creates a log method for a particular level
128
+
Pretty logging to `console` for client applications
129
+
130
+
### write
131
+
132
+
[src/util/client/consoleLogger.js:16-48](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/consoleLogger.js#L16-L48"Source code on GitHub")
[src/util/common/logForLevel.js:19-21](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/logForLevel.js#L19-L21"Source code on GitHub")
144
+
[src/util/client/logentriesLogger.js:10-23](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/logentriesLogger.js#L10-L23"Source code on GitHub")
197
145
198
-
Log at a level.
199
-
Must be bound to a logger instance.
146
+
Custom bunyan stream that transports to Logentries from client applications
[src/util/client/logentriesLogger.js:30-37](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/logentriesLogger.js#L30-L37"Source code on GitHub")
[src/util/server/rollbarLogger.js:12-21](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/server/rollbarLogger.js#L12-L21"Source code on GitHub")
168
+
[src/util/client/rollbarLogger.js:21-37](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/rollbarLogger.js#L21-L37"Source code on GitHub")
210
169
211
-
Custom bunyan stream that transports to Rollbar from a node process.
212
-
See <https://rollbar.com/docs/notifier/node_rollbar/> for integration details
170
+
Custom rollbar stream that transports to logentries from a browser
171
+
Wortks with a global Rollbar instance that is already initialized.
172
+
Note this expects rollbar to be loaded in the head, not via an npm module.
173
+
See <https://rollbar.com/docs/notifier/rollbar.js/#quick-start> for details on
174
+
integrating Rollbar in client apps
213
175
214
176
**Parameters**
215
177
216
-
-`token`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**, codeVersion, and environment
[src/util/server/rollbarLogger.js:31-44](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/server/rollbarLogger.js#L31-L44"Source code on GitHub")
185
+
[src/util/client/rollbarLogger.js:44-56](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/client/rollbarLogger.js#L44-L56"Source code on GitHub")
224
186
225
-
handles `err` and `req` properties, attaches any custom data,
[src/util/common/rollbar.js:11-18](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/rollbar.js#L11-L18"Source code on GitHub")
197
+
[src/util/common/rollbar.js:11-18](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/rollbar.js#L11-L18"Source code on GitHub")
[src/util/common/rollbar.js:25-28](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/common/rollbar.js#L25-L28"Source code on GitHub")
205
+
[src/util/common/rollbar.js:25-28](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/rollbar.js#L25-L28"Source code on GitHub")
245
206
246
207
Convert bunyan log level to rollbar level. Defaults to 'error'.
247
208
@@ -251,9 +212,48 @@ Convert bunyan log level to rollbar level. Defaults to 'error'.
-`logger`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** an instance of a `bunyan` logger to use internally.
225
+
this is meant to be used by the `child` method.
226
+
227
+
## ServerRollbarLogger
228
+
229
+
[src/util/server/rollbarLogger.js:12-21](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/server/rollbarLogger.js#L12-L21"Source code on GitHub")
230
+
231
+
Custom bunyan stream that transports to Rollbar from a node process.
232
+
See <https://rollbar.com/docs/notifier/node_rollbar/> for integration details
233
+
234
+
**Parameters**
235
+
236
+
-`token`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** , codeVersion, and environment
237
+
-`token.token`
238
+
-`token.codeVersion`
239
+
-`token.environment`
240
+
241
+
### write
242
+
243
+
[src/util/server/rollbarLogger.js:31-44](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/server/rollbarLogger.js#L31-L44"Source code on GitHub")
244
+
245
+
handles `err` and `req` properties, attaches any custom data,
[src/util/server/logentriesLogger.js:10-20](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/server/logentriesLogger.js#L10-L20"Source code on GitHub")
256
+
[src/util/server/logentriesLogger.js:10-20](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/server/logentriesLogger.js#L10-L20"Source code on GitHub")
257
257
258
258
Custom bunyan stream that transports to logentries from a node process
[src/util/server/requestLogger.js:12-48](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/server/requestLogger.js#L12-L48"Source code on GitHub")
271
+
[src/util/server/requestLogger.js:12-48](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/server/requestLogger.js#L12-L48"Source code on GitHub")
[src/util/server/requestLogger.js:24-47](https://github.com/wework/we-js-logger/blob/6cbf2586bf2f35bc49af4f92aa0dc47142ffb2ae/src/util/server/requestLogger.js#L24-L47"Source code on GitHub")
285
+
[src/util/server/requestLogger.js:24-47](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/server/requestLogger.js#L24-L47"Source code on GitHub")
0 commit comments