Commit graph

48 commits

Author SHA1 Message Date
Ahmed S. Darwish
5d4905ec31 log: Fix compilation error on non-systemd systems
Commit 262bdae0330e used symbols which are only available if systemd
support was compiled in. Fix by using the appropriate #ifdef guards.

Also document the resulting PULSE_LOG_JOURNAL environment variable
behavior if systemd journal support was not compiled in.

[Diwic: changed wording slightly.]

Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-09-25 15:05:43 +03:00
Ahmed S. Darwish
ac5b7b8d5c log: Introduce PULSE_LOG_JOURNAL environment variable
By introducing such an environment variable, applications using the
PA client libraries can configure these libraries to send their logs
directly to the journal.

While client libraries journal logging can be indirectly achieved
using PULSE_LOG_SYSLOG, this pollutes the journal. Meta data gets
replicated twice: once in the journal meta fields and once in the
syslog(3) plain-text message itself.

For attaching any backtraces, also introduce the PA-specific journal
meta field PULSE_BACKTRACE. This is the recommend journal practice
instead of appending any furuther data to the logging message itself.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-09-25 17:29:03 +05:30
Ondrej Holecek
5effc83479 update FSF addresses to FSF web page
FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html

Done automatically by sed-ing through sources.
2015-01-14 22:20:40 +02:00
Colin Guthrie
f7da58b73f build-sys: Clarify some systemd sub-component variable/define names.
We currently use the term SYSTEMD when referring to libsystemd-login
and JOURNAL when referring to libsystemd-journal.

I will be shortly adding support for libsystemd-daemon and in
preparation I figured it would be a good idea to clarify the names
used currently before adding another!
2014-11-03 12:32:23 +00:00
poljar (Damir Jelić)
d20ee7e7f2 log: Add support for the systemd journal
The journal is a component of systemd, that captures Syslog messages,
Kernel log messages, initial RAM disk and early boot messages as well
as messages written to STDOUT/STDERR of all services, indexes them and
makes this available to the user.

It can be used in parallel, or in place of a traditional syslog daemon,
such as rsyslog or syslog-ng.

The journal offers a couple of improvements over traditional logging
facilities (e.g. advanced filtering capabilities).

This patch adds support for logging directly to the journal using its
native API.
2013-12-20 13:06:04 +01:00
Arun Raghavan
82ee3dcee7 log: Add missing header
sys/stat.h is required for permisison flags such as S_IRUSR.
2013-09-17 21:54:09 +05:30
Tanu Kaskinen
b5e1c06a5e log: Harmonize log target output
The file targets used different output format than stderr and syslog.
That's now fixed.
2013-07-15 16:47:29 +03:00
Tanu Kaskinen
a1fdbcfaa7 log: Use pa_write() instead of write() 2013-07-15 16:46:06 +03:00
Tanu Kaskinen
bc2ed3482a log: Remove pa_log_set_fd()
The function isn't used any more.
2013-07-15 16:34:19 +03:00
Tanu Kaskinen
d90d99bd38 log: Fix thread name printing
Not all threads have a name.

Thanks to Pierre Ossman for the patch.
2013-07-11 14:15:33 +03:00
poljar (Damir Jelić)
d806b19714 Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
    find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
        -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
        -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
        -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
        -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;

and:
    sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
        -e '181,194!s/\bTRUE\b/true/' -e \
        '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-07-04 12:25:30 +03:00
Tanu Kaskinen
cffcaaec68 log: Fix error message
file_path contains the last tried file name, including the suffix, so
the error message was wrong:

    Tried to open target file '/tmp/test.log.99', '/tmp/test.log.99.1',
    '/tmp/test.log.99.2' ... '/tmp/test.log.99.99', but all failed.
2013-06-20 17:22:28 +03:00
Shuai Fan
b0bf132f8f cli, log: Improve the set-log-target functionality
Add a new log target 'newfile:PATH', and refactoring 'pa_log_target_type'.

Signed-off-by: Shuai Fan <shuai900217@126.com>
2013-06-20 16:34:57 +03:00
Arun Raghavan
c1cb0a6925 log: Add missing pulsecore/thread.h include 2011-08-12 20:04:15 +05:30
Lu Guanqun
6a03af769a log: add thread name
This patch displays thread name in the log, that would be more descriptive.
It improves Xingchao (xingchao.wang@intel.com)'s patch which shows thread id.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-09 15:06:01 +02:00
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Vincent Becker
f7acd4bdab log: Add a new log target to a file descriptor
This patch enables logging of text debug messages (pa_log feature) into a file or a device driver.
Example : pulseaudio --log-target=file:./mylog.txt

(Minor tweaks by Colin + Arun)
2011-03-18 12:32:51 +00:00
Maarten Bosmans
5699954d33 win32: flush stderr after log output 2011-02-17 12:02:30 +01:00
Lennart Poettering
1250b5d735 ratelimit: fix log levels of log suppression messages
When logging a suppression message do so on the same log level as the
suppressed messages.

Cherry picked by Colin Guthrie from ec5a785712
with a couple of additional changes due to extra limiting in master
that was not present in stable-queue.
2011-01-31 11:36:24 +00:00
Lennart Poettering
f732c23d95 log: add an easy way to disable log rate limiting
Should help with debuggin bugs like:

https://bugzilla.redhat.com/show_bug.cgi?id=554405
2010-02-09 22:31:55 +00:00
Marc-André Lureau
125c528896 pulse: move pa_rtclock_now in pulsecommon 2009-06-20 17:29:08 +03:00
Marc-André Lureau
5dcdd5e358 perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' find . -name '*.[ch]' 2009-06-19 19:04:04 +03:00
Lennart Poettering
39a26d8c6b log: use pa_logl() instead of pa_log_level() 2009-04-19 19:05:25 +02:00
Lennart Poettering
b9f1af48d2 log: print file name only when we have it 2009-04-19 19:04:50 +02:00
Lennart Poettering
9bea2503d9 increase log buffer further 2009-04-04 04:13:11 +02:00
Lennart Poettering
f6a6d01354 optionally skip initial frames in backtrace 2009-03-25 03:14:00 +01:00
Lennart Poettering
8460fac285 don't show full so path in backtrace 2009-03-25 02:50:57 +01:00
Colin Guthrie
86dee05aec Use LGPL 2.1 on all files previously using LGPL 2 2009-03-03 20:23:02 +00:00
Lennart Poettering
77779ead6d rework logging to make it more modular 2009-02-21 22:45:56 +01:00
Marc-André Lureau
ee0b5f7186 log: don't leak bt 2009-02-19 04:47:15 +01:00
Lennart Poettering
2557017178 suppress lines made up only of whitespace 2009-01-30 02:25:22 +01:00
Lennart Poettering
77c4ccfcaf add pa_log_rate_limit() 2009-01-23 23:58:57 +01:00
Lennart Poettering
f4320d83a2 Support showing a backtrace on log messages 2008-10-21 19:13:15 +02:00
Lennart Poettering
82c46f2238 do not cleanup staticly allocated memory unless we are in valgrind mode 2008-10-04 00:14:02 +02:00
Lennart Poettering
002e7a703a output relative timestamps in addition to absolute timestamps when logging 2008-09-01 02:39:27 +02:00
Lennart Poettering
1acf394356 change default log level for the library to PA_LOG_ERROR to avoid spamming to stderr more often 2008-08-29 21:43:50 +02:00
Lennart Poettering
bdcb3a493c optionally add timestampts to every line logged 2008-08-29 19:33:06 +02:00
Lennart Poettering
8ae83d618e get rid of svn $ keywords 2008-06-18 23:23:21 +03:00
Lennart Poettering
045c1d602d merge glitch-free branch back into trunk
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-15 23:34:41 +00:00
Lennart Poettering
a67c21f093 merge 'lennart' branch back into trunk.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-10-28 19:13:50 +00:00
Lennart Poettering
872018efc8 Minor optimization: read log level character code from array
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1457 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-05-27 16:37:05 +00:00
Pierre Ossman
3016c7561d Prefix log lines with a character indicating level.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1427 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-02-14 09:26:48 +00:00
Pierre Ossman
06211b7c8f Add copyright notices to all relevant files. (based on svn log)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-02-13 15:35:19 +00:00
Pierre Ossman
521daf6f0a Huge trailing whitespace cleanup. Let's keep the tree pure from here on,
mmmkay?


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-01-04 13:43:45 +00:00
Lennart Poettering
c2db5f8864 fix a memory leak
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1280 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-19 01:14:59 +00:00
Lennart Poettering
1bc62d5ec6 rework logging subsystem, to implicitly include __FILE__ in pa_log() calls. In addition we now record the line numbers and function names of pa_log calls. However, those are only shown If $PULSE_LOG_META is set.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1271 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-18 21:26:01 +00:00
Lennart Poettering
230f97a4a4 s/POLYP/PULSE/g
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1041 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-06-19 23:56:54 +00:00
Lennart Poettering
f44ba09265 big s/polyp/pulse/g
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1033 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-06-19 21:53:48 +00:00
Renamed from src/polypcore/log.c (Browse further)