| Commit message (Collapse) | Author | Files | Lines |
|
|
|
Don't free the string right after calling log_init_file(). Add a new
function log_deinit() that frees the string on shutdown.
This fixes cycling the log file after SIGHUP (Mantis ticket 0003524).
|
|
|
|
config_get_path() was somewhat flawed, because it pretended to be a
function, when it really had a side effect. The second flaw was that
it did not return the parser error, instead it aborted the whole
process, which is bad style. The new function returns a duplicated
(modified) string that must be freed by the caller, and returns a
GError on failure.
|
|
|
|
|
|
|
|
Replaced all occurrences of g_error() with MPD_ERROR() located in a new header
file 'mpd_error.h'. This macro uses g_critical() to print the error message
and then exits gracefully in contrast to g_error() which would internally call
abort() to produce a core dump.
The macro name is distinctive and allows to find all places with dubious error
handling. The long-term goal is to get rid of MPD_ERROR() altogether. To
facilitate the eventual removal of this macro it was added in a new header
file rather than to an existing header file.
This fixes #2995 and #3007.
|
|
|
|
|
|
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
|
|
Add a "mode" argument to open_cloexec() instead.
|
|
Added the "fd_util" library, which attempts to use the new thread-safe
Linux system calls pipe2(), accept4() and the options O_CLOEXEC,
SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is
not thread safe.
This is particularly important for the "pipe" output plugin (and
others, such as JACK/PulseAudio), because we were heavily leaking file
descriptors to child processes.
|
|
Don't hold a file descriptor on root's tty when syslog is used for
logging.
|
|
Don't free an internal configuration value in log_init(). Call
config_get_path() instead of manually calling parsePath().
|
|
|
|
Use GLib the logging functions g_debug(), g_error() instead.
|
|
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
|
|
Define the GLib logging domain in the following libraries: conf,
daemon, event_pipe, log.
|
|
|
|
All config_get_block_*() functions should accept constant config_param
pointers.
|
|
Renamed functions, types, variables.
|
|
gcc doesn't know that g_error() never returns. Work around the gcc
warning.
|
|
|
|
Removed GLib logging wrappers which are not used anymore.
|
|
If a log message does not include a newline character, append it.
|
|
|
|
|
|
The log file is duped to STDOUT_FILENO and STDERR_FILENO. No need to
keep another copy of it in out_fd all the time. We only need it once
once in setup_log_output().
|
|
Allow logging to syslog if log_file is configured to "syslog".
|
|
Added log_init_file() and log_init_stdout(), preparing for other
logging targets.
|
|
The logging library currently has 3 constructor functions: initLog(),
open_log_files(), setup_log_output(), called in this order. Merged
the first two.
|
|
|
|
Declare log_threshold as GLogLevelFlags.
|
|
If the user wants the log files with a specific mode, he has to start
MPD with the correct umask. Don't hard-code that.
This fixes a bug: when log cycling failed, MPD would not restore the
old umask.
|
|
Merged code from open_log_files() and cycle_log_files().
|
|
Removed the "error_file" option. There is only one log file now. If
a user wants to see only the errors, he should configure a log_level.
|
|
Make "secure" a log level different from "default". "secure" should be
right between "default" and "verbose". Map "default" to Glib's
"MESSAGE" log level.
|
|
We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF
macros.
|
|
We want to remove gcc.h eventually. This takes care of all the
G_GNUC_NORETURN macros.
|
|
|
|
The threshold was only checked in the deprecated logging functions
(ERROR(), WARNING(), ...). Add the check to the GLib logging handler.
|
|
|
|
When logging to a file, log_charset would be NULL and g_convert()
would abort.
|
|
When logging to the terminal, we should print messages in the system
character set. Convert all messages in this case.
|
|
Use the bool data type for flags.
|
|
Install a default handler which writes to stdout or stderr, and
prepends a time stamp. This looks just like the 0.13.x logger.
|
|
The logging functions from log.h are deprecated, and the code should
use GLib logging instead. Make ERROR(), WARNING() etc. call g_logv()
internally.
|
|
Renamed the variable "logLevel" to "log_threshold".
|
|
The warning buffer is a complex piece of code for no good reason.
Remove it and find a better solution, e.g. open the log file earlier.
|