From 13f5f64e8eaa590d7b20b887809faec94181bb41 Mon Sep 17 00:00:00 2001 From: "Frederic G. MARAND" Date: Mon, 19 Dec 2016 14:49:01 +0100 Subject: [PATCH] Issue #23: structured context. --- doc/dic_example/filog.yml | 12 ++++ doc/logger.dot | 111 +++++++++++++++++---------------- src/Logger.js | 19 ++++-- src/Senders/MongodbSender.js | 5 +- src/Senders/SenderBase.js | 13 ++-- src/Senders/SyslogSender.js | 1 - src/Senders/TeeSender.js | 18 +++++- src/Strategies/StrategyBase.js | 38 +++-------- test/unit/logContextTest.js | 3 +- test/unit/logLevelsTest.js | 1 + test/unit/mongodbSenderTest.js | 10 +-- test/unit/serializationTest.js | 5 +- test/unit/stringifyTest.js | 6 +- 13 files changed, 131 insertions(+), 111 deletions(-) diff --git a/doc/dic_example/filog.yml b/doc/dic_example/filog.yml index 4d0b15e..99c1bc0 100644 --- a/doc/dic_example/filog.yml +++ b/doc/dic_example/filog.yml @@ -18,27 +18,34 @@ services: filog.client.sender.console: class: 'ConsoleSender' + public: false filog.client.sender.meteor_http_client: class: 'MeteorHttpClientSender' + public: false filog.client.processor.browser: class: 'BrowserProcessor', + public: false filog.client.processor.routing: class: 'RoutingProcessor' + public: false filog.client.processor.meteor_user: class: 'MeteorUserProcessor' arguments: ['@Meteor'] + public: false filog.client.sender: class: 'TeeSender' arguments: ['@filog.client.sender.console', '@filog.client.meteor_http_client'] + public: false filog.client.strategy: class: 'TrivialStrategy' arguments: ['@filog.client.sender'] + public: false logger.client: class: 'ClientLogger' @@ -50,22 +57,27 @@ services: filog.server.sender.mongo: class: 'MongodbSender' arguments: ['@Mongo', '%filog.mongo.collection%'] + public: false filog.server.sender.syslog: class: 'SyslogSender' arguments: [ '%filog.syslog.facility%', null, null, null, [ depth: '%filog.syslog.depth%' ] ] + public: false filog.server.sender: class: 'TeeSender' arguments: ['@filog.server.sender.mongo', '@filog.server.sender.syslog'] + public: false filog.server.strategy: class: 'TrivialStrategy' arguments: ['@filog.server.sender', '@Webapp'] + public: false filog.server.processor.meteor_user: class: 'MeteorUserProcessor' arguments: ['@Meteor'] + public: false logger.server: class: 'ServerLogger' diff --git a/doc/logger.dot b/doc/logger.dot index bc21770..fedc0d7 100644 --- a/doc/logger.dot +++ b/doc/logger.dot @@ -1,88 +1,92 @@ digraph logger { rankdir = LR; node [ shape="octagon", color="#c0c0c0" ]; - Client; - Server; - + Client [ label="Client app"]; + Server [ label="Server app"]; + node [ shape="record", color="#c0c0c0" ]; + subgraph cluster_loggers { + label = "Loggers\nProvide a way for the application to emit messages"; + + ClientLogger; + Logger [ label="