Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8dc92ad2
Commit
8dc92ad2
authored
Dec 28, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: deprecated "error_file" option
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.
parent
d838a1ad
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
31 deletions
+5
-31
NEWS
NEWS
+2
-0
mpd.conf.5
doc/mpd.conf.5
+0
-3
mpdconf.example
doc/mpdconf.example
+0
-1
cmdline.c
src/cmdline.c
+1
-1
log.c
src/log.c
+2
-26
No files found.
NEWS
View file @
8dc92ad2
...
...
@@ -4,6 +4,8 @@ ver 0.15 - (200?/??/??)
- iso9660
- zip
* Add RVA2 tag support
* the option "error_file" was removed, all messages are logged into
"log_file"
ver 0.14 (2008/12/25)
* audio outputs:
...
...
doc/mpd.conf.5
View file @
8dc92ad2
...
...
@@ -51,9 +51,6 @@ This specifies where the db file will be stored.
.TP
.B log_file <file>
This specifies where the log file should be located.
.TP
.B error_file <file>
This specifies where the error file should be located.
.SH OPTIONAL PARAMETERS
.TP
.B pid_file <file>
...
...
doc/mpdconf.example
View file @
8dc92ad2
...
...
@@ -26,7 +26,6 @@ db_file "~/.mpd/database"
# settings.
#
log_file "~/.mpd/log"
error_file "~/.mpd/error-log"
###############################################################################
...
...
src/cmdline.c
View file @
8dc92ad2
...
...
@@ -84,7 +84,7 @@ void parseOptions(int argc, char **argv, Options *options)
{
"no-daemon"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
option_no_daemon
,
"don't detach from console"
,
NULL
},
{
"stdout"
,
0
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
stdOutput
,
"print messages to std
out and std
err"
,
NULL
},
"print messages to stderr"
,
NULL
},
{
"verbose"
,
'v'
,
0
,
G_OPTION_ARG_NONE
,
&
options
->
verbose
,
"verbose logging"
,
NULL
},
{
.
long_name
=
NULL
}
...
...
src/log.c
View file @
8dc92ad2
...
...
@@ -44,17 +44,14 @@ static const char *log_charset;
static
bool
stdout_mode
=
true
;
static
int
out_fd
=
-
1
;
static
int
err_fd
=
-
1
;
static
const
char
*
out_filename
;
static
const
char
*
err_filename
;
static
void
redirect_logs
(
void
)
{
assert
(
out_fd
>=
0
);
assert
(
err_fd
>=
0
);
if
(
dup2
(
out_fd
,
STDOUT_FILENO
)
<
0
)
FATAL
(
"problems dup2 stdout : %s
\n
"
,
strerror
(
errno
));
if
(
dup2
(
err
_fd
,
STDERR_FILENO
)
<
0
)
if
(
dup2
(
out
_fd
,
STDERR_FILENO
)
<
0
)
FATAL
(
"problems dup2 stderr : %s
\n
"
,
strerror
(
errno
));
}
...
...
@@ -71,8 +68,6 @@ mpd_log_func(const gchar *log_domain,
G_GNUC_UNUSED
GLogLevelFlags
log_level
,
const
gchar
*
message
,
G_GNUC_UNUSED
gpointer
user_data
)
{
FILE
*
file
=
log_level
<=
G_LOG_LEVEL_WARNING
?
stderr
:
stdout
;
char
*
converted
;
if
(
log_level
>
(
int
)
log_threshold
)
...
...
@@ -90,7 +85,7 @@ mpd_log_func(const gchar *log_domain,
if
(
log_domain
==
NULL
)
log_domain
=
""
;
fprintf
(
file
,
"%s%s%s%s"
,
fprintf
(
stderr
,
"%s%s%s%s"
,
stdout_mode
?
""
:
log_date
(),
log_domain
,
*
log_domain
==
0
?
""
:
": "
,
message
);
...
...
@@ -106,9 +101,6 @@ void initLog(bool verbose)
g_log_set_default_handler
(
mpd_log_func
,
NULL
);
/* unbuffer stdout, stderr is unbuffered by default, leave it */
setvbuf
(
stdout
,
(
char
*
)
NULL
,
_IONBF
,
0
);
if
(
verbose
)
{
log_threshold
=
G_LOG_LEVEL_DEBUG
;
return
;
...
...
@@ -143,13 +135,6 @@ void open_log_files(bool use_stdout)
FATAL
(
"problem opening log file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
param
=
parseConfigFilePath
(
CONF_ERROR_FILE
,
1
);
err_filename
=
param
->
value
;
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
FATAL
(
"problem opening error file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
umask
(
prev
);
}
...
...
@@ -198,7 +183,6 @@ int cycle_log_files(void)
if
(
stdout_mode
)
return
0
;
assert
(
out_filename
);
assert
(
err_filename
);
DEBUG
(
"Cycling log files...
\n
"
);
close_log_files
();
...
...
@@ -211,12 +195,6 @@ int cycle_log_files(void)
return
-
1
;
}
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
{
ERROR
(
"error re-opening error file: %s
\n
"
,
err_filename
);
return
-
1
;
}
umask
(
prev
);
redirect_logs
();
...
...
@@ -229,8 +207,6 @@ void close_log_files(void)
if
(
stdout_mode
)
return
;
assert
(
out_fd
>=
0
);
assert
(
err_fd
>=
0
);
close
(
out_fd
);
close
(
err_fd
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment