Commit Graph

13 Commits

Author SHA1 Message Date
Dan Williams
27e1936277 core: rework logging code to remove log message truncation (bgo #698312)
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.
2013-04-18 11:23:57 -05:00
Aleksander Morgado
12d6e59c86 log: enable MBIM traces if running in debug mode 2013-04-17 15:19:38 +02:00
Dan Williams
2d700043ab core: use g_unix_signal_add() for more reliable Unix signal handling
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.
2013-02-12 15:48:39 -06:00
Aleksander Morgado
120b660fd4 core,log: include logging from the 'Qmi' log domain
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
2012-10-30 16:06:27 +01:00
Aleksander Morgado
f1bcc531a3 log: enable QMI traces when showing debug logs
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.
2012-10-09 16:28:46 +02:00
Aleksander Morgado
181f9c85f0 log: only include LOC and method name in debug logs if running with --debug
If the modem is started with --log-level=DEBUG, they will not be shown.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
c58db4e015 core: start using our newly defined errors 2012-03-15 14:14:25 +01:00
Nathan Williams
1b73fa1541 Add a DBus interface for setting the log level.
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>
2011-06-30 12:25:02 -05:00
Michael Biebl
871097327b logging: use glong for secs and usecs 2011-02-25 18:21:52 -06:00
Dan Williams
7707117862 log: fix spacing so messages line up 2011-02-25 11:18:55 -06:00
Dan Williams
245b893e98 logging: make gcc 4.4.3 happy about ignored unused results 2011-01-24 14:13:28 -06:00
Dan Williams
98ec26283a logging: shut up compiler warnings about unused result from write(2)
We actually don't care about the result here.  But we do in other
places, so we want to keep the warning in general.
2011-01-24 14:05:07 -06:00
Dan Williams
16039244bb core: rework logging
Make it more flexible, add logging to a file, and absolute and
relative timestamps.
2011-01-23 20:51:48 -06:00