[systemd-devel] [RFC 00/12] Bugfixes for CONFIG_VT=n
Kay Sievers
kay at vrfy.org
Tue Dec 10 16:50:34 PST 2013
On Wed, Dec 11, 2013 at 1:35 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 28.11.13 09:08, David Herrmann (dh.herrmann at gmail.com) wrote:
>
>> A few comments beforehand:
>> - regarding logging in libraries: I *want* verbose errors/warnings in
>> sd-gfx. Especially if modesetting, keymap-compilation or bus-requests
>> fail, I want some rather verbose messages in the log. Considering that
>> if a single page-flip fails, I will not abort but continue the modeset
>> (you don't want your console to abort due to minor timing issues in
>> the DRM driver, right?), so the application might not even get an
>> -EXYZ error value. I tried adding a ->log_fn() like libudev, but then
>
> That libudev does that is mostly because it predates log.c, it wouldn't
> do that either anymore if we'd write it now...
Hmm, for complex subsystems, error objects probably make the most
sense, like we have for dbus.
For things that really just want to log things from libraries, I still
think that allowing to hook up the user of the library to its own
logging facility makes some sense; instead of logging not enough, or
just spitting things out on stderr.
Not sure what a good advise is here for library, we should sort that
out and also update libabc with that, if it's significantly different
from what udev does.
>> again, sd-gfx is internal so I skipped that and just called log_meta()
>> directly. Is that fine for now?
Please do not call log_meta() for debugging, unless you wrap it in
your own macro to avoid composition of potentially expensive
parameters to this function. Debug messages are usually thrown away,
but only *inside* the function and all parameters need to be prepared
to just get thrown away. For that reason, log_debug() wraps a check in
it.
Kay
More information about the systemd-devel
mailing list