Commit Graph

16 Commits

Author SHA1 Message Date
Pablo Neira Ayuso 04139f14b6 vty: integration with logging framework
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-03-19 18:33:48 -03:00
Harald Welte 2822296ddb LOGGING: configure logging from the vty
We can now configure logging to (multiple) files, stderr and syslog
from the vty command line in a persistent way (config file)
2011-02-18 20:37:04 +01:00
Harald Welte 76e72abe32 LOGGING: Pass the log level down to the log target output function
This will be required for mapping osmocore log levels to syslog priorities.
2011-02-17 15:52:39 +01:00
Sylvain Munaut af5ee34c35 Make sure we don't user std{err,in,out} if they don't exist.
This is required for target build in libosmocore

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 14:38:17 +02:00
Harald Welte 3086c394de logging: add log target logging into text file and log target destroy function 2010-08-25 19:10:50 +02:00
Harald Welte 0083cd381c logging: rename tgt_stdout to tgt_file 2010-08-25 18:10:19 +02:00
Harald Welte a439a3a505 logging: Make sure we don't use "end of color" code if colors are turned off 2010-07-30 21:01:54 +02:00
Harald Welte 40481e8954 move hexdump() from logging.c to utils.c 2010-07-30 11:40:32 +02:00
Harald Welte 4ebdf74728 rename log_info to osmo_log_info to avoid namespace clash with app 2010-05-25 22:28:40 +02:00
Harald Welte 3fb0b6f26e Create libosmovty as library from OpenBSC VTY functions 2010-05-25 22:28:39 +02:00
Harald Welte 7638af95fd logging: add log_vty_{level,category}_string() 2010-05-11 16:39:22 +02:00
Harald Welte 9ac2225ff4 logging: introuduce log_level_str() to obtain the name of a log level 2010-05-11 11:19:40 +02:00
Harald Welte a3b844cf45 logging: only compile stderr target if we actualy have stderr 2010-03-27 00:04:40 +08:00
Harald Welte 01fd5cb3f0 only include strings.h if it is actually preent 2010-03-26 23:51:31 +08:00
Harald Welte cc6313cc69 logging: fix default initialization of per-category loglevels
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-26 22:04:03 +08:00
Harald Welte 3ae2758fba rename 'debug' interface to 'logging' interface
It's not really about debugging, but about generic logging...
2010-03-26 21:26:01 +08:00