summaryrefslogtreecommitdiff
path: root/src/shared/log.h
AgeCommit message (Collapse)Author
2015-01-25log: add new log output mode, that prints to console, butLennart Poettering
prefixes with syslog priority This is useful when we execute our own programs, reading output from its STDERR, and want to retain priority information. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-17log: fix log_full_errno() with custom facilitiesDavid Herrmann
Make sure to extract the log-priority when comparing against max-log-level, otherwise, we will always drop those messages. This fixes bus-proxyd to properly send warnings on policy blocks. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m"); Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25shared/log: add log_trace as compile-time optional debuggingZbigniew Jędrzejewski-Szmek
Repetetive messages can be annoying when running with SYSTEMD_LOG_LEVEL=debug, but they are sometimes very useful when debugging problems. Add log_trace which is like log_debug but becomes a noop unless LOG_TRACE is defined during compilation. This makes it easy to enable very verbose logging for a subset of programs when compiling from source. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-14src/shared: some stylistic changesAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05src/shared: refactor shared codeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-17Rename src/shared to src/include, a saner nameAnthony G. Basile
2012-11-16src/udev/log.c: remove log_parse_environment()Anthony G. Basile
2012-11-15Final step of revamping the build systemAnthony G. Basile
The structure of the source tree is basically correct and this is about as far as we can go without hacking at the C code.
2012-11-15Isolation of udev code from remaining systemdAnthony G. Basile
This commit is a first attempt to isolate the udev code from the remaining code base. It intentionally does not modify any files but purely delete files which, on a first examination, appear to not be needed. This is a sweeping commit which may easily have missed needed code. Files can be retrieved by doing a checkout from the previous commit: git checkout 2944f347d0 -- <filename>
2012-10-16journal: don't export MESSAGE_ID() macroLennart Poettering
If it is exported it would need to be prefixed, but since we need it exclusively internally so far, simply move it to an internal header.
2012-09-03journal: suppress structured messages if they'd go to the consoleLennart Poettering
2012-09-03journal: generate structured journal messages for a number of eventsLennart Poettering
2012-07-26log: out-of-line __log_oom()Michal Schmidt
The callers' code gets smaller.
2012-07-26log: log_oom() must be a macroMichal Schmidt
2012-07-26log.h: new log_oom() -> int -ENOMEM, use itShawn Landden
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
2012-07-19use #pragma once instead of foo*foo #define guardsShawn Landden
#pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported in other compilers. I've been using and maintaining (rebasing) this patch for a while now, as it annoyed me to see #ifndef fooblahfoo, etc all over the place, almost arrogant about the annoyance of having to define all these names to perform a commen but neccicary functionality, when a completely superior alternative exists. I havn't sent it till now, cause its kindof a style change, and it is bad voodoo to mess with style that has been established by more established editors. So feel free to lambast me as a crazy bafoon. v2 - preserve externally used headers
2012-05-22log: make sure generators never log into the journal to avoid activation ↵Lennart Poettering
deadlocks This makes all generators log to kmsg by default.
2012-04-12relicense to LGPLv2.1 (with exceptions)Lennart Poettering
We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
2012-04-10util: move all to shared/ and split external dependencies in separate ↵Kay Sievers
internal libraries Before: $ ldd /lib/systemd/systemd-timestamp linux-vdso.so.1 => (0x00007fffb05ff000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f90aac57000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f90aaa53000) librt.so.1 => /lib64/librt.so.1 (0x00007f90aa84a000) libc.so.6 => /lib64/libc.so.6 (0x00007f90aa494000) /lib64/ld-linux-x86-64.so.2 (0x00007f90aae90000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f90aa290000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f90aa08a000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f90a9e6e000) After: $ ldd systemd-timestamp linux-vdso.so.1 => (0x00007fff3cbff000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f5eaa1c3000) librt.so.1 => /lib64/librt.so.1 (0x00007f5ea9fbb000) libc.so.6 => /lib64/libc.so.6 (0x00007f5ea9c04000) /lib64/ld-linux-x86-64.so.2 (0x00007f5eaa3fc000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f5ea9a00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5ea97e4000)