Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marvin Scholz
Icecast-Server
Commits
0b7e65c3
Commit
0b7e65c3
authored
Nov 07, 2014
by
Philipp Schafft
🦁
Browse files
send errorlog (loglevel WARN) to stderr prior to opening the real logfiles. closes #1886
svn path=/icecast/trunk/icecast/; revision=19271
parent
1d567696
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.c
View file @
0b7e65c3
...
...
@@ -200,6 +200,16 @@ static int _parse_config_opts(int argc, char **argv, char *filename, int size)
return
-
1
;
}
static
int
_start_logging_stdout
(
void
)
{
errorlog
=
log_open_file
(
stderr
);
if
(
errorlog
<
0
)
return
0
;
log_set_level
(
errorlog
,
2
/* WARN */
);
return
1
;
}
static
int
_start_logging
(
void
)
{
char
fn_error
[
FILENAME_MAX
];
...
...
@@ -218,8 +228,7 @@ static int _start_logging(void)
log_set_trigger
(
errorlog
,
config
->
logsize
);
log_set_archive_timestamp
(
errorlog
,
config
->
logarchive
);
}
else
{
errorlog
=
log_open_file
(
stderr
);
log_to_stderr
=
1
;
/* this is already in place because of _start_logging_stdout() */
}
if
(
errorlog
<
0
)
{
...
...
@@ -434,6 +443,11 @@ int main(int argc, char **argv)
#if !defined(_WIN32) || defined(_CONSOLE) || defined(__MINGW32__) || defined(__MINGW64__)
/* startup all the modules */
initialize_subsystems
();
if
(
!
_start_logging_stdout
())
{
_fatal_error
(
"FATAL: Could not start logging on stderr."
);
shutdown_subsystems
();
return
1
;
}
#endif
/* parse the config file */
config_get_config
();
...
...
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