Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
494 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | // eslint-disable-next-line no-console
|
---|
| 2 | const consoleLog = console.log.bind(console);
|
---|
| 3 |
|
---|
| 4 | function consoleAppender(layout, timezoneOffset) {
|
---|
| 5 | return (loggingEvent) => {
|
---|
| 6 | consoleLog(layout(loggingEvent, timezoneOffset));
|
---|
| 7 | };
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | function configure(config, layouts) {
|
---|
| 11 | let layout = layouts.colouredLayout;
|
---|
| 12 | if (config.layout) {
|
---|
| 13 | layout = layouts.layout(config.layout.type, config.layout);
|
---|
| 14 | }
|
---|
| 15 | return consoleAppender(layout, config.timezoneOffset);
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | module.exports.configure = configure;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.