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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/client.js#L80-L86"Source code on GitHub")
31
+
[src/client.js:80-86](https://github.com/wework/we-js-logger/blob/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/client.js#L80-L86"Source code on GitHub")
32
32
33
33
A logger than can be used in browsers
34
34
@@ -38,60 +38,118 @@ 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
-
## logForLevel
41
+
## ClientConsoleLogger
42
42
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")
43
+
[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")
44
44
45
-
Creates a log method for a particular level
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/e04eb30bd53ea9275562bce42e3cae6db44e4836/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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/logForLevel.js#L19-L21"Source code on GitHub")
61
+
[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")
56
62
57
-
Log at a level.
58
-
Must be bound to a logger instance.
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/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/logentriesLogger.js#L30-L37"Source code on GitHub")
[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")
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/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/client/rollbarLogger.js#L44-L56"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
+
66
124
## BUNYAN_CONFIG_FIELDS
67
125
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")
126
+
[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")
69
127
70
128
Config keys that should always be passed to
71
129
`bunyan.createLogger`
72
130
73
131
## DEFAULT_ROOT_FIELDS
74
132
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")
133
+
[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")
76
134
77
135
Whitelist of extra config keys that should be
78
136
passed to `bunyan.createLogger` to form
79
137
root logger fields.
80
138
81
139
## BUNYAN_LOGGER_LEVELS
82
140
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")
141
+
[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")
84
142
85
143
Array of bunyan's different log levels.
86
144
<https://github.com/trentm/node-bunyan#levels>
87
145
88
146
## DEFAULT_CONFIG
89
147
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")
148
+
[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")
91
149
92
150
## assembleConfig
93
151
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")
152
+
[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")
95
153
96
154
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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/config.js#L78-L80"Source code on GitHub")
169
+
[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")
112
170
113
171
Create a config objct for bunyan from a full `we-js-logger` config object.
114
172
Extra keys passed to `bunyan.createLogger` become root logger fields, pass
@@ -121,70 +179,51 @@ a custom `config.rootFields` to control this behavior
121
179
122
180
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** config for bunyan.createLogger
123
181
124
-
## ClientConsoleLogger
125
-
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")
127
-
128
-
Pretty logging to `console` for client applications
129
-
130
-
### write
182
+
## logForLevel
131
183
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")
184
+
[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/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")
145
-
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")
196
+
[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/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")
209
+
[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")
169
210
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
211
+
Custom bunyan stream that transports to Rollbar from a node process.
212
+
See <https://rollbar.com/docs/notifier/node_rollbar/> for integration details
-`token`**[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**, codeVersion, and environment
217
+
-`token.token`
218
+
-`token.codeVersion`
219
+
-`token.environment`
182
220
183
221
### write
184
222
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")
223
+
[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")
186
224
187
-
Transport logs to Rollbar
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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/rollbar.js#L11-L18"Source code on GitHub")
236
+
[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:25-28](https://github.com/wework/we-js-logger/blob/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/src/util/common/rollbar.js#L25-L28"Source code on GitHub")
244
+
[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")
206
245
207
246
Convert bunyan log level to rollbar level. Defaults to 'error'.
208
247
@@ -212,48 +251,9 @@ 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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/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/e04eb30bd53ea9275562bce42e3cae6db44e4836/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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/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/e04eb30bd53ea9275562bce42e3cae6db44e4836/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/fa1b54f0a902bab1012ece287e7cb426ad2d0a60/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/e04eb30bd53ea9275562bce42e3cae6db44e4836/src/util/server/requestLogger.js#L24-L47"Source code on GitHub")
0 commit comments