aboutsummaryrefslogtreecommitdiffstats
path: root/src/logging.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-19logging: fix corrupted outputPablo Neira Ayuso1-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."
2011-05-04logging: make sure the output is null-terminatedPablo Neira Ayuso1-0/+2
If we reach the buffer size or snprintf fails, we want to make sure that the output is null-terminated.
2011-05-04logging: remove workaround now that _output() has been reworkedPablo Neira Ayuso1-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.
2011-05-04logging: rework _output() functionPablo Neira Ayuso1-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.
2011-05-04logging: several memory allocation belong to tall_log_ctx contextPablo Neira Ayuso1-2/+2
Several talloc_zero in logging use NULL context, use tall_log_ctx instead.
2011-05-04logging: fix missing description of global loglevelPablo Neira Ayuso1-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
2011-03-29logging: Add the 'all' category back to the log level commandHolger Hans Peter Freyther1-1/+1
This is required to be able to set a global log level. The all command is emitted by the VTY logging code.
2011-03-28utils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.hPablo Neira Ayuso1-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().
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-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>
2011-03-19vty: integration with logging framework0.1.31Pablo Neira Ayuso1-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.
2011-02-18LOGGING: configure logging from the vtyHarald Welte1-3/+21
We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
2011-02-17LOGGING: Pass the log level down to the log target output functionHarald Welte1-5/+6
This will be required for mapping osmocore log levels to syslog priorities.
2010-09-17Make sure we don't user std{err,in,out} if they don't exist.Sylvain Munaut1-4/+5
This is required for target build in libosmocore Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-08-25logging: add log target logging into text file and log target destroy functionHarald Welte1-0/+50
2010-08-25logging: rename tgt_stdout to tgt_fileHarald Welte1-5/+5
2010-07-30logging: Make sure we don't use "end of color" code if colors are turned offHarald Welte1-1/+2
2010-07-30move hexdump() from logging.c to utils.cHarald Welte1-19/+0
2010-05-25rename log_info to osmo_log_info to avoid namespace clash with appHarald Welte1-15/+15
2010-05-25Create libosmovty as library from OpenBSC VTY functionsHarald Welte1-1/+1
2010-05-11logging: add log_vty_{level,category}_string()0.1.6Harald Welte1-0/+46
2010-05-11logging: introuduce log_level_str() to obtain the name of a log levelHarald Welte1-0/+5
2010-03-27logging: only compile stderr target if we actualy have stderrHarald Welte1-0/+8
2010-03-26only include strings.h if it is actually preentHarald Welte1-0/+5
2010-03-26logging: fix default initialization of per-category loglevelsHarald Welte1-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.
2010-03-26rename 'debug' interface to 'logging' interface0.1.2Harald Welte1-0/+345
It's not really about debugging, but about generic logging...