summaryrefslogtreecommitdiffstats
path: root/src/logging.c
Commit message (Collapse)AuthorAgeFilesLines
* logging: Copy the filter_fn and fix the IMSI filter in OpenBSCHolger Hans Peter Freyther2013-12-291-0/+1
| | | | | | | The filter_fn has not been copied into the new structure breaking the imsi and other filters in OpenBSC. Looking at the code we should also introduce a callback for the reset of the context so we could use subscr_get/subscr_put on the subscriber structure.
* Revert "Follow up fix for the log level "everything""Harald Welte2013-03-191-3/+0
| | | | This reverts commit a6428d2376034d619f342897d3ce415b3f9a3584.
* Revert "Fix log level "everything" and make it equal to "debug""Harald Welte2013-03-191-1/+1
| | | | This reverts commit cd6ed82d1ff48f47ad9e33e6322df62896a76ed5.
* logging: add new log_targets_reopen() functionHarald Welte2013-03-181-0/+20
| | | | | This function will re-open all existing log files in the application, praticularly useful for SIGHUP handlers in case of logrotate
* Follow up fix for the log level "everything"Holger Hans Peter Freyther2013-02-271-0/+3
| | | | | | | | | | | | Commit cd6ed82d1ff48f47ad9e33e6322df62896a76ed5 made "EVERYTHING" map to LOGL_DEBUG but when writing out the configuration the following would be written: logging level all unknown 0x0 This happend because no string was found for the value 0. Address it by adding a legacy check for 0 and write out the str from the index 0. Currently this is "EVERYTHING".
* Fix log level "everything" and make it equal to "debug"Harald Welte2013-02-191-1/+1
| | | | | | As Holger points out "logging level XXX everything" wasn't working, as it sets category->loglevel to 0, which is checked in osmo_vlogp() and will never get logged.
* add some missing doxygen annotation for libosmocore functionsHarald Welte2013-01-111-0/+9
|
* logging.c: Do not crash on empty category nameNico Golde2012-09-271-5/+7
| | | | | log_parse_category_mask(), skip log category name right away if name is NULL to prevent passing a NULL ptr to strlen.
* logging: Introduce a print_filename flag for the logtargetHolger Hans Peter Freyther2012-09-111-5/+17
| | | | | | 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-2/+3
| | | | | | 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-4/+4
| | | | | | | | | | | | 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
* 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-0/+6
| | | | | 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-3/+3
|
* logging: add osmo_vlogp() as vararg / va_list compatible functionHarald Welte2011-08-311-4/+5
|
* doxygen documentation for logging frameworkHarald Welte2011-08-171-5/+79
|
* logging: fix parsing of logging mask (-d DMI case)Pablo Neira Ayuso2011-08-111-0/+5
| | | | | | Without this patch, `-d DMI' enables logging for DMI and DMIB. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* use the 'L' prefix in debug names (DLINP instead of DINP)Harald Welte2011-07-291-4/+4
|
* remove DLRSL and DLNM, we don't need themHarald Welte2011-07-211-12/+0
| | | | | 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-0/+34
| | | | | | 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.
* fix against corrupted output in parallel loggingHarald Welte2011-07-021-1/+1
| | | | | | | | | In 825607672215b7a12ea6e201a89cd5209f6d657f it was attempted to fix a bug previously introduced by logging related changes. The problem is that a va_list can be corrupted after it has been used once, so we need to va_copy before each successive use. And if we copy it, we also need to use the copy, and not the original ;)
* Fix the generation of the log_categories string + LAPDMHarald Welte2011-06-271-4/+7
| | | | | | | | ... I should do more testing :( Conflicts: src/logging.c
* logging: make sure to add the internal categories, as intendedHarald Welte2011-06-271-0/+6
|
* add LAPDm code from osmocom-bb into libosmocoreHarald Welte2011-06-271-0/+6
|
* logging: introduce library-internal logging categoriesHarald Welte2011-06-271-20/+92
| | | | | | | | | | 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.
* logging: fix corrupted outputPablo Neira Ayuso2011-05-191-0/+6
| | | | | | | | | | | | | | | | | | | | | Harald reported a problem in the logging: http://lists.osmocom.org/pipermail/openbsc/2011-May/002896.html Reverting 81e9636454294ae10ef9bc8bf149dd0248afce76 seems to fix the problem. However, that workaround looks ugly. Holger gives us another clue on what was wrong: http://lists.osmocom.org/pipermail/openbsc/2011-May/002905.html While digging in the manpage, I found this: "The functions vprintf(), vfprintf(), vsprintf(), vsnprintf() are equivalent to the functions printf(), fprintf(), sprintf(), snprintf(), respectively, except that they are called with a va_list instead of a variable number of arguments. These functions do not call the va_end macro. Consequently, the value of ap is undefined after the call. The application should call va_end(ap) itself afterwards."
* logging: make sure the output is null-terminatedPablo Neira Ayuso2011-05-041-0/+2
| | | | | If we reach the buffer size or snprintf fails, we want to make sure that the output is null-terminated.
* logging: remove workaround now that _output() has been reworkedPablo Neira Ayuso2011-05-041-12/+3
| | | | | | This patch removes a workaround to fix some strange memory corruption now that _output() has been completely reworked and we make use of snprintf appropriately.
* logging: rework _output() functionPablo Neira Ayuso2011-05-041-23/+26
| | | | | | This patch reworks _output() to handle snprintf() return value appropriately and to use one single buffer to build the logging string, instead of four.
* logging: several memory allocation belong to tall_log_ctx contextPablo Neira Ayuso2011-05-041-2/+2
| | | | | Several talloc_zero in logging use NULL context, use tall_log_ctx instead.
* logging: fix missing description of global loglevelPablo Neira Ayuso2011-05-041-0/+7
| | | | | | | | | | | OpenBSC> logging level all Global setting for all subsystems <----- this description was missing rll A-bis Radio Link Layer (RLL) [...] This problem was introduced by myself in: "vty: integration with logging framework" 04139f14b6197e3ec996133a945af3fa8a68fb7a
* logging: Add the 'all' category back to the log level commandHolger Hans Peter Freyther2011-03-291-1/+1
| | | | | This is required to be able to set a global log level. The all command is emitted by the VTY logging code.
* utils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.hPablo Neira Ayuso2011-03-281-18/+8
| | | | | This is used by the logging to vty conversion functions by now, but it may be of help for other functions that plan to use snprintf().
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-3/+3
| | | | | | | | | | | | 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>
* vty: integration with logging frameworkPablo Neira Ayuso2011-03-191-23/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logging categories are registered by the applications, like osmo-nitb, during startup. Thus, the VTY have to provide the logging commands according to the logging categories that the application has registered. Before this patch, the VTY contained the logging categories hardcoded. Thus, any change in the logging categories by the application would not be shown by the VTY. So far, this was not a problem because all applications used the same logging categories. However, according to what Harald told me, this may be a problem in the future. This patch resolve the lack of integration between the logging framework and the VTY by generating the VTY logging commands from the logging categories registered. Since this patch changes one function of the libosmocore API, it follows another patch for the openbsc application to get in sync with the new function layout. I have reworked and renamed the functions: * log_vty_category_string() * log_vty_level_string() to provide the new ones that generate the exact output that VTY requires. This patch does not release the memory allocated by talloc_zero_size() to store the VTY strings for the commands and the description. I found no exit function that can clean up resources that were allocated.
* LOGGING: configure logging from the vtyHarald Welte2011-02-181-3/+21
| | | | | We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
* LOGGING: Pass the log level down to the log target output functionHarald Welte2011-02-171-5/+6
| | | | This will be required for mapping osmocore log levels to syslog priorities.
* Make sure we don't user std{err,in,out} if they don't exist.Sylvain Munaut2010-09-171-4/+5
| | | | | | This is required for target build in libosmocore Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* logging: add log target logging into text file and log target destroy functionHarald Welte2010-08-251-0/+50
|
* logging: rename tgt_stdout to tgt_fileHarald Welte2010-08-251-5/+5
|
* logging: Make sure we don't use "end of color" code if colors are turned offHarald Welte2010-07-301-1/+2
|
* move hexdump() from logging.c to utils.cHarald Welte2010-07-301-19/+0
|
* rename log_info to osmo_log_info to avoid namespace clash with appHarald Welte2010-05-251-15/+15
|
* Create libosmovty as library from OpenBSC VTY functionsHarald Welte2010-05-251-1/+1
|
* logging: add log_vty_{level,category}_string()Harald Welte2010-05-111-0/+46
|
* logging: introuduce log_level_str() to obtain the name of a log levelHarald Welte2010-05-111-0/+5
|
* logging: only compile stderr target if we actualy have stderrHarald Welte2010-03-271-0/+8
|
* only include strings.h if it is actually preentHarald Welte2010-03-261-0/+5
|
* logging: fix default initialization of per-category loglevelsHarald Welte2010-03-261-2/+12
| | | | | | | Before this patch, there was a bug in the code caused by a memcpy from one data structure to another. unfortuantely the data structures were not the same, so we have to explicitly iterate over the array and assign the structure members manually.