| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The variable is not used anymore as the decision is done in the
newly added check_log_to_target method.
|
|
|
|
|
|
| |
There doesn't seem to be a reason not to check the filter. Update
and extend the test. Currently the filter function will be called
once for the log check and once for the output of it.
|
|
|
|
|
|
| |
Extract the mapping of the subsystem number and the checking for
the loglevel to a inline method that is shared between the new
and old.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently when using 'logging print extended-timestamp 1', the
subsecond part (milliseconds) of the printed timestamp is always 0.
This makes it difficult to correlate log entries with PCAP file
entries if there are many of them per second.
This patch changes _output in logging.c to use gettimeofday() instead
of time() when extended timestamps are enabled and replaces the '000'
by the milliseconds computed from tv_usec.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
We tried to fix it but it isn't that easy. The original fix was
cd6ed82d1ff48f47ad9e33e6322df62896a76ed5 but we had to revert it
as "everything" is present/used in existing config files.
If we ever change the ABI we can make everything be something
that is > 0. For now use a wording that makes it obvious that
people should not use "everything".
|
|
|
|
|
|
| |
First we check if a color is defined and then we call it again
and use the result. Avoid the second call and use the result of
the previous call.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
We want to use libosmocore/libosmovty in the GGSN sourcecode
and reserve a global region here.
|
|
|
|
| |
... and make libctrl code use it
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reverts commit a6428d2376034d619f342897d3ce415b3f9a3584.
|
|
|
|
| |
This reverts commit cd6ed82d1ff48f47ad9e33e6322df62896a76ed5.
|
|
|
|
|
| |
This function will re-open all existing log files in the application,
praticularly useful for SIGHUP handlers in case of logrotate
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
log_parse_category_mask(), skip log category name right away if
name is NULL to prevent passing a NULL ptr to strlen.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
|
|
|
| |
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Without this patch, `-d DMI' enables logging for DMI and DMIB.
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
|
| |
|
|
|
|
|
| |
They are not used anywhere in our libraries, so they should be defined
by the respective applications
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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 ;)
|
|
|
|
|
|
|
|
| |
... I should do more testing :(
Conflicts:
src/logging.c
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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."
|
|
|
|
|
| |
If we reach the buffer size or snprintf fails, we want to make sure
that the output is null-terminated.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This patch reworks _output() to handle snprintf() return value
appropriately and to use one single buffer to build the logging
string, instead of four.
|
|
|
|
|
| |
Several talloc_zero in logging use NULL context, use tall_log_ctx
instead.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This is required to be able to set a global log level. The all
command is emitted by the VTY logging code.
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We can now configure logging to (multiple) files, stderr and syslog
from the vty command line in a persistent way (config file)
|
|
|
|
| |
This will be required for mapping osmocore log levels to syslog priorities.
|