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
0a0736fc
Commit
0a0736fc
authored
Feb 19, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: added log_early_init() for early debug messages
parent
84437acf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
cmdline.c
src/cmdline.c
+5
-0
log.c
src/log.c
+9
-0
log.h
src/log.h
+11
-0
No files found.
src/cmdline.c
View file @
0a0736fc
...
...
@@ -18,6 +18,7 @@
#include "cmdline.h"
#include "path.h"
#include "log.h"
#include "conf.h"
#include "decoder_list.h"
#include "config.h"
...
...
@@ -123,6 +124,10 @@ void parseOptions(int argc, char **argv, Options *options)
if
(
option_version
)
version
();
/* initialize the logging library, so the configuration file
parser can use it already */
log_early_init
(
options
->
verbose
);
if
(
option_create_db
&&
option_no_create_db
)
g_error
(
"Cannot use both --create-db and --no-create-db
\n
"
);
...
...
src/log.c
View file @
0a0736fc
...
...
@@ -217,6 +217,15 @@ parse_log_level(const char *value, unsigned line)
}
}
void
log_early_init
(
bool
verbose
)
{
if
(
verbose
)
log_threshold
=
G_LOG_LEVEL_DEBUG
;
log_init_stdout
();
}
void
log_init
(
bool
verbose
,
bool
use_stdout
)
{
const
struct
config_param
*
param
;
...
...
src/log.h
View file @
0a0736fc
...
...
@@ -25,6 +25,17 @@
G_GNUC_PRINTF
(
1
,
2
)
void
DEBUG
(
const
char
*
fmt
,
...);
G_GNUC_PRINTF
(
1
,
2
)
G_GNUC_NORETURN
void
FATAL
(
const
char
*
fmt
,
...);
/**
* Configure a logging destination for daemon startup, before the
* configuration file is read. This allows the daemon to use the
* logging library (and the command line verbose level) before it's
* daemonized.
*
* @param verbose true when the program is started with --verbose
*/
void
log_early_init
(
bool
verbose
);
void
log_init
(
bool
verbose
,
bool
use_stdout
);
void
setup_log_output
(
bool
use_stdout
);
...
...
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