Merge lp:~fahad-aizaz/hipl/logging into lp:hipl
Status: | Rejected |
---|---|
Rejected by: | René Hummen |
Proposed branch: | lp:~fahad-aizaz/hipl/logging |
Merge into: | lp:hipl |
Diff against target: |
318 lines (+83/-32) 9 files modified
firewall/main.c (+2/-0) hipd/hipd.c (+4/-4) hipd/init.c (+1/-1) hipd/user.c (+6/-0) lib/core/builder.c (+1/-0) lib/core/conf.c (+8/-3) lib/core/debug.c (+57/-12) lib/core/debug.h (+3/-12) lib/core/icomm.h (+1/-0) |
To merge this branch: | bzr merge lp:~fahad-aizaz/hipl/logging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
René Hummen | Disapprove | ||
Stefan Götz (community) | Needs Fixing | ||
Diego Biurrun | Needs Information | ||
Miika Komu | Pending | ||
Review via email: mp+65788@code.launchpad.net |
This proposal supersedes a proposal from 2011-06-09.
Description of the change
The SYSLOG functionality has been added. A new logdebug level has been added.
HIP daemon is now configured so that when it is executed in background mode: all the debug messages are logged into the syslog. The configuration file for syslog which dictates what and how messages are suppose to be logged can be altered to user requirement. If the HIP daemon is executed in the foreground mode then in that case all the messages are logged both on STDERR and SYSLOG.
NOTE: HIP uses FACILITY = LOG_LOCAL6; which can be used in syslog configuration file.
A new logdebug level LOGDEBUG_LOW has been added to the debug levels in which the application can operate. i.e. (NONE, LOW, MEDIUM, ALL); The following matrix describes what kind of messages will be displayed based on selection of logdebug
=======
| NONE | DIE, ASSERT
-------
| LOW | DIE, ASSERT, ERROR
-------
| MEDIUM | DIE, ASSERT, ERROR, INFO
-------
| ALL | DIE, ASSERT, ERROR, INFO, DEBUG
=======
The debug level at which the application can be executed is either hardcoded or otherwise selected
by the debug switch chosen when the application is executed.
NOTE: In case of HIP, in the end it is the debug level set in the configuration file of hip daemon
"hipd_config" that dictates which debug level the application must execute.
=======
Removed the conflicts. Required review again
Unmerged revisions
- 5978. By Fahad Aizaz
-
Updated the documentation about debugging parameters
- 5977. By Fahad Aizaz
-
Handling of LOGDEBUG_LOW (debug level) updated
After adding the support for debug level messages LOGDEBUG_LOW to debug.c
and debug.h and its functionality in hip daemon, is now extended to other
files that were using the LOGDEBUG.So now if LOGDEBUG_LOW is required by other modules, it can be used since
its support has been added to the project.NOTE: LOGDEBUG levels are (NONE, LOW, MEDIUM, ALL). The messages with
debug_level (DIE/ASSERT, ERROR, INFO, DEBUG) are displayed on STDERR,
STDERR and SYSLOG, or SYSLOG only depends on the selection of LOGDEBUG
level either by (hardcoded) using in the application or in the
configuration file. Other than that the debug switch applied at the
execution of hip daemon, retains its effect until the configuration file
is read and the daemon is set according to the settings in the
configuration file. - 5976. By Fahad Aizaz
-
Updated comment for logdebug and debug_level
Mistake in the comment is rectified
- 5975. By Fahad Aizaz
-
LOGDEBUG levels have been updated to accomodate a new level
A new level LOGDEBUG_LOW has been added to the enumeration of logdebug
enum logdebug {LOGDEBUG_ALL,LOGDEBUG_ MEDIUM, LOGDEBUG_ LOW,LOGDEBUG_ NONE}; The logdebug enum selects the type of messages (error messages that can
be displayed (die, assert, error, info, debug)
Following matrix shows the type of messages that can displayed at each
level:
============== ======= ======= ======= ======= ======= ===
| logdebug | debug_level (of messages) |
-------------- ------- ------- ------- ------- ------- ---
| NONE | DIE/ASSERT |
-------------- ------- ------- ------- ------- ------- ---
| LOW | DIE/ASSERT, ERROR |
-------------- ------- ------- ------- ------- ------- ---
| MEDIUM | DIE/ASSERT, ERROR, INFO |
-------------- ------- ------- ------- ------- ------- ---
| ALL | DIE/ASSERT, ERROR, INFO, DEBUG |
============== ======= ======= ======= ======= ======= === NOTE: hip daemon now starts with the logdebug = LOW; i.e. only the
die, assert and error messages are displayed. - 5974. By Fahad Aizaz
-
Default behaviour for logging in Test mode and Production mode.
This updates marks that the default behaviour for logging in both
test mode and production mode will be the same i.e. logging will be
in either form - 5973. By Fahad Aizaz
-
SYSLOG functionality extended
The debug messages (info, error, debug etc) has been now placed both
on console and syslog based on the switch used to execute hipd i.e.
if hipd is executed in background mode then all the error messages
will be placed into syslog only otherwise the error messages will be
displayed on console window and also stored to syslog.An additional switch has been added: LOGTYPE_
STDERR_ SYSLOG which
identifies whether messages need to be placed both on stderr & syslog
or not. Also the default functionality of the application with regard
to logging error messages has been changed. Now whether application
executed in production mode or testing mode, in both cases error
messages will be logged.Usage:
And process that needs to use this fuctionality simply has to set the
logtype to the desired option: e.g. logtype = LOGTYPE_SYSLOGNOTE:
This is hardcoded functionality i.e. all daemon processes log into
syslog and all foreground processes log error messages to console and
syslog.SYSLOG facility that is used is: LOCAL6
Using LOCAL6 enables the localized logging for error messages. This can
be achived by configuring unix/linux syslog configuration.
e.g. local6.* -/var/log/hip.log
will log all messages from the processes using the facility LOCAL6
into hip.log file.
Hi Fahad!
Nice feature. Please take care of the merge conflicts with trunk and resubmit the merge proposal.
Cheers,
Stefan