summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/logging.h
Commit message (Collapse)AuthorAgeFilesLines
* Update doxygen annotations in libosmocoreHarald Welte2016-05-051-17/+23
| | | | | This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
* Add log_fini() function to release all memory allocated by logging frameworkHarald Welte2016-05-051-0/+1
| | | | | This is e.g. quite useful to call at the end of test code, in order to show that all memory allocated actually is released before exit().
* log: Add conditional logging based on log_check_levelJacob Erlbeck2016-02-291-4/+20
| | | | | | | | | | | | | | Currently the LOGP/DEBUGP arguments are always evaluated even if no logging will happen at all. This can be expensive, for instance if hexdumps or pretty printed object names are generated. This causes high base load especially on embedded devices and is a major part of CPU usage e.g. of the osmo-pcu. This commit uses the log_check_level function to avoid the evaluation of the parameters if it is known in advance, that no logging entry will be generated. Sponsored-by: On-Waves ehf
* log: Add log_check_level functionJacob Erlbeck2016-02-291-0/+1
| | | | | | | | | | | | | | | | | | This commit adds this predicate function which can be used to avoid the execution of code if a certain log level is not enabled. The function will only return 0 (false), if it is sure that a logging call for the same facility and level will not produce any output. This safety criterion shall ensure, that no logging output is lost due to the use of this predicate as a guard. On the other hand, even if the predicate returns != 0 (true), no logging output might get generated by a similar logging command. Note that the current implementation is not focussed on performance, which could be improved by using a lookup table instead of iterating through every target. Sponsored-by: On-Waves ehf
* log: Add new DLSTATS log levelJacob Erlbeck2015-11-021-1/+2
| | | | | | | | This log level is used by the stats subsystem log reporter to report statistics to level INFO. Note that the default level of DLSTATS is NOTICE. Sponsored-by: On-Waves ehf
* logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther2014-12-051-0/+6
| | | | | | | | | | | | We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602
* gtp: Add a global region for the gtp library of OpenGGSNHolger Hans Peter Freyther2014-12-041-1/+2
| | | | | We want to use libosmocore/libosmovty in the GGSN sourcecode and reserve a global region here.
* logging: Add ability to save/print current log filtersHarald Welte2014-08-251-0/+16
| | | | | | This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
* libctrl: Add DLCTRL as logging context for the control interfaceHarald Welte2014-08-211-1/+2
| | | | ... and make libctrl code use it
* include: Switch to #pragma once patternSylvain Munaut2014-06-161-4/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* logging: add new log_targets_reopen() functionHarald Welte2013-03-181-0/+1
| | | | | This function will re-open all existing log files in the application, praticularly useful for SIGHUP handlers in case of logrotate
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-271-0/+5
| | | | | | | The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
* Revert "Added a ring buffer log target to store the last N log messages."Holger Hans Peter Freyther2013-02-271-5/+0
| | | | | | | I noticed some more issues and it is the easiest to revert and include the fixed version. This reverts commit 73377229bb33ab79682ce4b126a63602d13304ad.
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-271-0/+5
| | | | | | | The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
* misc: Doxygen tweaks: fixed some typos and minor errorsKaterina Barone-Adesi2013-02-151-1/+1
| | | | | Doxygen generates quite a lot of warnings on libosmocore. Some of them are obvious typos - this patch aims to fix such low-hanging fruit.
* logging: Introduce a print_filename flag for the logtargetHolger Hans Peter Freyther2012-09-111-0/+3
| | | | | | Introduce a print_filename attribute for each logtarget. Initialize it with 1 to be backward compatible with earlier versions. The bit is taken from an existint bitfield. There were at least six bits left of the byte.
* logging: Mark the log_info_cat pointer as constsHolger Hans Peter Freyther2012-09-111-1/+1
| | | | | | Applications should keep the log area in a static const area. Mark the pointer as const to address compiler warnings in OpenBSC, cast the const away for the osmo_log_info as it is not declared as const.
* logging: Fix compile breakage introduced by the warning fixesHolger Hans Peter Freyther2012-07-121-1/+1
| | | | | | | | | | | | Make sure the declaration and definition match, add const to the functions called by logp/logp2. Compile output: logging.c:317: error: conflicting types for 'logp' ../include/osmocom/core/logging.h:34: note: previous declaration of 'logp' was here logging.c:327: error: conflicting types for 'logp2' ../include/osmocom/core/logging.h:168: note: previous declaration of 'logp2' was here make[3]: *** [logging.lo] Error 1
* logging: Avoid compiler warnings when compiling c++ codeAndreas Eversberg2012-07-101-2/+2
| | | | | | this patch i use to suppress warnings when compiling osmo-pcu (c++). since __FILE__ is constant, the called logging function with parameter "file" must be constant too, in order to avoid compiler warnings.
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsm/sms: Added DLSMS debuggingAndreas Eversberg2011-11-121-1/+2
| | | | | Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* Changed logging of LAPD from DLLAPDM to DLLAPDroot2011-10-101-1/+1
|
* logging: include stdarg.h for va_listChristoph Fritz2011-09-011-0/+1
| | | | | | | | | | fixes tiny compile error: CC socket.lo In file included from socket.c:13: ../include/osmocom/core/logging.h:31: error: expected declaration specifiers or ‘...’ before ‘va_list’ make[3]: *** [socket.lo] Error 1
* logging: add osmo_vlogp() as vararg / va_list compatible functionHarald Welte2011-08-311-0/+3
|
* doxygen documentation for logging frameworkHarald Welte2011-08-171-25/+44
|
* start to add doxygen documentation to libosmocore headersHarald Welte2011-08-161-1/+24
|
* fix off-by-one error in OSMO_NUM_DLIBHarald Welte2011-07-291-1/+1
| | | | | This bug was introduced in 95f7eb288c4b8b69d61fa8d68957fb21f09e11e5 and it caused a segfault on 'write terminal'
* remove DLRSL and DLNM, we don't need themHarald Welte2011-07-211-3/+1
| | | | | They are not used anywhere in our libraries, so they should be defined by the respective applications
* make sure we don't have namespace clashes between libraries and appsHarald Welte2011-07-191-6/+6
| | | | | | | | * All loging prefixes in libraries should be DL like DLINP * All signals / subsystems should be called S_L_* SS_L_* * All command nodes should be called L_*_NODE This makes sure existinc code still compiles as expected
* logging: add libosmo-abis logging subsystemsPablo Neira Ayuso2011-07-181-1/+7
| | | | | | This adds the libosmo-abis logging subsystems to libosmocore, it uses the new change that harald proposed based on negative numbers for library logging subsystems.
* don't use signed bit-fieldsHarald Welte2011-07-161-2/+2
| | | | detected by Smatch
* add LAPDm code from osmocom-bb into libosmocoreHarald Welte2011-06-271-1/+2
|
* logging: introduce library-internal logging categoriesHarald Welte2011-06-271-6/+11
| | | | | | | | | | We do this by using a trick: library-internal log categories use negative subsystem numbers, which are converted into positive array indexes at the time of logging. library-internal log categories need to be knwo at compile-time, while application-specified categories now are of unlimited number, as they are dynamically allocated.
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-0/+154
This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>