Re: [PATCH 5/5] log: Add support for journal logging

2017-06-21 Thread Aleksander Morgado
On 21/06/17 12:59, Torsten Hilbrich wrote: > This logging is available if the software was build with the configure > option --with-systemd-journal. > > It will be enabled by default if libsystemd is found. > > The runtime parameter --log-journal enables to output of log messages > to the

Re: [PATCH 3/5] log: Add mapping from glib loglevel to syslog priority

2017-06-21 Thread Aleksander Morgado
On 21/06/17 12:54, Torsten Hilbrich wrote: > Improves readability of log_handler function. Pushed to git master, thanks. > --- > src/mm-log.c | 44 > 1 file changed, 20 insertions(+), 24 deletions(-) > > diff --git a/src/mm-log.c b/src/mm-log.c >

Re: [PATCH 4/5] log: Introduce function pointer to handle different log backends

2017-06-21 Thread Aleksander Morgado
On 21/06/17 12:58, Torsten Hilbrich wrote: > This allows for easier additions of other logging mechanism. > > Using the syslog loglevel as parameter because we need to be able to > map the MMLogLevel and the GLogLevelFlags to a common representation > when using the log_backend in _mm_log and

Re: [PATCH 1/5] log: Refactor evaluation of log level

2017-06-21 Thread Aleksander Morgado
On 21/06/17 12:54, Torsten Hilbrich wrote: > Starting with adding a typed enum type for the log level named > MMLogLevel. > > Suggested-By: Aleksander Morgado > > The level was checked twice in _mm_log. Once at the beginning and > again when turning the level into both

Re: [PATCH 2/5] log: Refactor log level text output

2017-06-21 Thread Aleksander Morgado
On 21/06/17 12:54, Torsten Hilbrich wrote: > Adding a helper function to turn the log level into the text. Also > add an internal flag to disable this output. This flag will become > useful when adding systemd journal support. Pushed to git master, thanks. > --- > src/mm-log.c | 34

[PATCH 2/5] log: Refactor log level text output

2017-06-21 Thread Torsten Hilbrich
Adding a helper function to turn the log level into the text. Also add an internal flag to disable this output. This flag will become useful when adding systemd journal support. --- src/mm-log.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git

[PATCH 3/5] log: Add mapping from glib loglevel to syslog priority

2017-06-21 Thread Torsten Hilbrich
Improves readability of log_handler function. --- src/mm-log.c | 44 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/mm-log.c b/src/mm-log.c index eea0bac..151b40d 100644 --- a/src/mm-log.c +++ b/src/mm-log.c @@ -82,6 +82,25 @@

[PATCHv3]: Logging cleanup and systemd journal support

2017-06-21 Thread Torsten Hilbrich
This series of patches is based on master. It start with cleaning up some parts of the logging code. The the existing logging support (supporting syslog and file-based logging) is split into two different functions using a function pointer to select them. Then the support for logging using the

[PATCH 1/5] log: Refactor evaluation of log level

2017-06-21 Thread Torsten Hilbrich
Starting with adding a typed enum type for the log level named MMLogLevel. Suggested-By: Aleksander Morgado The level was checked twice in _mm_log. Once at the beginning and again when turning the level into both the syslog priority and some descriptive text which was

Re: [PATCHv2]: Logging cleanup and systemd journal support

2017-06-21 Thread Aleksander Morgado
On 21/06/17 10:29, Torsten Hilbrich wrote: > This series of patches is based on the "Logging and --help > updates" series posted by Aleksander Morgado > . Could you rebase the patches on top of git master and resend? Looks like they don't apply cleanly. -- Aleksander

[PATCH 2/5] log: Refactor log level text output

2017-06-21 Thread Torsten Hilbrich
Adding a helper function to turn the log level into the text. Also add an internal flag to disable this output. This flag will become useful when adding systemd journal support. --- src/mm-log.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git

[PATCH 4/5] log: Introduce function pointer to handle different log backends

2017-06-21 Thread Torsten Hilbrich
This allows for easier additions of other logging mechanism. Using the syslog loglevel as parameter because we need to be able to map the MMLogLevel and the GLogLevelFlags to a common representation when using the log_backend in _mm_log and log_handler. The syslog level is more suitable because

[PATCH 3/5] log: Add mapping from glib loglevel to syslog priority

2017-06-21 Thread Torsten Hilbrich
Improves readability of log_handler function. --- src/mm-log.c | 44 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/mm-log.c b/src/mm-log.c index 7b4fa7e..2b7907c 100644 --- a/src/mm-log.c +++ b/src/mm-log.c @@ -83,6 +83,25 @@

[PATCH 5/5] log: Add support for journal logging

2017-06-21 Thread Torsten Hilbrich
This logging is available if the software was build with the configure option --with-systemd-journal. It will be enabled by default if libsystemd is found. The runtime parameter --log-journal enables to output of log messages to the systemd journal. Please note that the journal priority field

[PATCH 2/5] log: Refactor log level text output

2017-06-21 Thread Torsten Hilbrich
Adding a helper function to turn the log level into the text. Also add an internal flag to disable this output. This flag will become useful when adding systemd journal support. --- src/mm-log.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git

[PATCHv2]: Logging cleanup and systemd journal support

2017-06-21 Thread Torsten Hilbrich
This series of patches is based on the "Logging and --help updates" series posted by Aleksander Morgado . It start with cleaning up some parts of the logging code. The the existing logging support (supporting syslog and file-based logging) is split into two different

[PATCH 1/5] log: Refactor evaluation of log level

2017-06-21 Thread Torsten Hilbrich
Starting with adding a typed enum type for the log level named MMLogLevel. Suggested-By: Aleksander Morgado The level was checked twice in _mm_log. Once at the beginning and again when turning the level into both the syslog priority and some descriptive text which was

[PATCH 4/5] log: Introduce function pointer to handle different log backends

2017-06-21 Thread Torsten Hilbrich
This allows for easier additions of other logging mechanism. Using the syslog loglevel as parameter because we need to be able to map the MMLogLevel and the GLogLevelFlags to a common representation when using the log_backend in _mm_log and log_handler. The syslog level is more suitable because

[PATCH 3/5] log: Add mapping from glib loglevel to syslog priority

2017-06-21 Thread Torsten Hilbrich
Improves readability of log_handler function. --- src/mm-log.c | 44 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/mm-log.c b/src/mm-log.c index 7b4fa7e..2b7907c 100644 --- a/src/mm-log.c +++ b/src/mm-log.c @@ -83,6 +83,25 @@