Age | Commit message (Collapse) | Author |
|
|
|
We need this when building printable representations of helper types
like the MMBearerProperties object.
|
|
There are certain cases where we perform a lot of data processing just
for logging purposes. Having methods that let us know whether a given
log level will be printed before doing all that data processing is useful.
|
|
|
|
Just to make all of them the same avoid needing extra whitespaces just
for alignment of the text after this tag.
|
|
We're bumping the current "INFO" level messages to the new "MSG"
level, also making the new level the default.
The old "INFO" level will be used to setup an intermediate level of
logging which is not as verbose as "DEBUG" but still provides some
capabilities to analyze the behavior of a modem.
|
|
|
|
The log level of the libraries was not honoring the log level
configured in MM, so we would see debug messages reported even if the
default log level configured was INFO or MSG.
The format of the logs emitted by the libraries was also not following
the format of the rest of MM logs, e.g. they would not include timing
info in the logs which would make it hard to follow certain event
transitions.
Make the libraries logging use the ModemManager logging method, to fix
all those issues.
|
|
|
|
During mm logging, some of the information like simIccId, Telephone
numbers need to be hidden from displaying in the logs to protect
some of the user information.
Implemented for MBIM requiring libmbim 1.27.6, which is the
development version that includes the needed API.
|
|
This fixes a few (fatal in gcc 11) warnings.
See https://gitlab.gnome.org/GNOME/glib/-/issues/600
|
|
Add the 'Qrtr' domain so logging from libqrtr is enabled.
|
|
Running with G_DEBUG=fatal-warnings will end up reporting warning logs
with G_LOG_FLAG_FATAL, which breaks our own logging logic.
|
|
|
|
|
|
So that we can provide the specific object id in every log associated
to a given object.
|
|
mm-log.c: In function ‘glib_to_syslog_priority’:
mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_RECURSION’ not handled in switch [-Wswitch-enum]
99 | switch (level) {
| ^~~~~~
mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_FATAL’ not handled in switch [-Wswitch-enum]
mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_INFO’ not handled in switch [-Wswitch-enum]
mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_MASK’ not handled in switch [-Wswitch-enum]
|
|
mm-log.c: In function ‘mm_to_syslog_priority’:
mm-log.c:82:5: warning: switch missing default case [-Wswitch-default]
82 | switch (level) {
| ^~~~~~
mm-log.c: In function ‘log_level_description’:
mm-log.c:118:5: warning: switch missing default case [-Wswitch-default]
118 | switch (level) {
| ^~~~~~
|
|
|
|
This logging is available if the software was build with the configure
option --with-systemd-journal.
It will be enabled by default if libsystemd is found.
The runtime parameter --log-journal enables to output of log messages
to the systemd journal.
Please note that the journal priority field has the same value as the
syslog level so no conversion is required here.
|
|
This allows for easier additions of other logging mechanism.
Using the syslog loglevel as parameter because we need to be able to
map the MMLogLevel and the GLogLevelFlags to a common representation
when using the log_backend in _mm_log and log_handler.
The syslog level is more suitable because it supports more values than
the MMLogLevel.
|
|
Improves readability of log_handler function.
|
|
Adding a helper function to turn the log level into the text. Also
add an internal flag to disable this output. This flag will become
useful when adding systemd journal support.
|
|
Starting with adding a typed enum type for the log level named
MMLogLevel.
Suggested-By: Aleksander Morgado <aleksander@aleksander.es>
The level was checked twice in _mm_log. Once at the beginning and
again when turning the level into both the syslog priority and some
descriptive text which was added to the log level. Removing the check
at the second location as it was redundant.
Also adding a helper function to turn the MMLogLevel into the syslog
equivalent. This will become handy when adding support for systemd
journal.
|
|
The user can build the project passing custom CFLAGS to enable the
function location information, e.g.:
$ ./configure --prefix=/usr CFLAGS="-DMM_LOG_FUNC_LOC"
|
|
Use a static GString which will resize itself if the log message
is bigger than the current string size, but will also ensure we
don't do a ton of memory reallocation on every log message.
Previously all log messages were trucated at 512 bytes due to the
log buffer char array being 512 bytes long.
|
|
|
|
There were a few problems with MM's existing signal handling, first
of which was that calling g_main_loop_quit() from a signal handler
only works 50% of the time due to severe restrictions on what you
can do from the handler. This caused INT or TERM to sometimes be
ignored by MM.
Instead, use the glib signal functions which ensure that the handler
is run in the right context, where we can do anything we want.
|
|
Sync with libqmi:
commit 2835a53732fdae32478dd954a9ee3fa8afd93cab
Author: Aleksander Morgado <aleksander@lanedo.com>
Date: Tue Oct 30 15:02:24 2012 +0100
libqmi-glib: define library G_LOG_DOMAIN
|
|
Use the new `qmi_utils_set_traces_enabled()' to specify that we want QMI traces
when running with DEBUG logs.
Sync with libqmi:
commit 35dcb4bb6ed2755d968cf97d69faff9ed5f6871f
Author: Aleksander Morgado <aleksander@lanedo.com>
Date: Tue Oct 9 13:44:16 2012 +0200
libqmi-glib: message traces compiled always
Message traces have been very useful when debugging issues in the protocol, and
we should avoid requiring a full recompilation in order to get them enabled.
Instead, we provide two new API methods, `qmi_utils_(get|set)_traces_enabled()',
which allow specifying whether traces should be dumped with g_debug() or not.
|
|
If the modem is started with --log-level=DEBUG, they will not be shown.
|
|
|
|
Lifted almost entirely from similar code in NetworkManager.
BUG=chromium-os:15197
TEST='dbus-send --print-reply --system --dest=org.freedesktop.ModemManager /org/freedesktop/ModemManager org.freedesktop.ModemManager.SetLogging string:DEBUG'
Also try valid log levels 'ERR', 'WARN', 'INFO', and an invalid log level, such as 'ABCDE'.
Change-Id: I2bddcd0319f4966dd293b119f68e7cc1697949b7
Reviewed-on: http://gerrit.chromium.org/gerrit/3134
Tested-by: Nathan J. Williams <njw@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
|
|
|
|
|
|
|
|
We actually don't care about the result here. But we do in other
places, so we want to keep the warning in general.
|
|
Make it more flexible, add logging to a file, and absolute and
relative timestamps.
|