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
0b4e0b7b
Commit
0b4e0b7b
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LogInit: use struct ConfigData
parent
a9b8d5ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
LogInit.cxx
src/LogInit.cxx
+4
-4
LogInit.hxx
src/LogInit.hxx
+3
-1
Main.cxx
src/Main.cxx
+1
-1
No files found.
src/LogInit.cxx
View file @
0b4e0b7b
...
...
@@ -22,7 +22,7 @@
#include "LogBackend.hxx"
#include "Log.hxx"
#include "config/Param.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "config/Option.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
...
...
@@ -118,7 +118,7 @@ log_early_init(bool verbose)
}
void
log_init
(
bool
verbose
,
bool
use_stdout
)
log_init
(
const
ConfigData
&
config
,
bool
verbose
,
bool
use_stdout
)
{
#ifdef ANDROID
(
void
)
verbose
;
...
...
@@ -126,14 +126,14 @@ log_init(bool verbose, bool use_stdout)
#else
if
(
verbose
)
SetLogThreshold
(
LogLevel
::
DEBUG
);
else
if
(
const
auto
&
param
=
config
_get_p
aram
(
ConfigOption
::
LOG_LEVEL
))
else
if
(
const
auto
&
param
=
config
.
GetP
aram
(
ConfigOption
::
LOG_LEVEL
))
SetLogThreshold
(
parse_log_level
(
param
->
value
.
c_str
(),
param
->
line
));
if
(
use_stdout
)
{
out_fd
=
STDOUT_FILENO
;
}
else
{
const
auto
*
param
=
config
_get_p
aram
(
ConfigOption
::
LOG_FILE
);
const
auto
*
param
=
config
.
GetP
aram
(
ConfigOption
::
LOG_FILE
);
if
(
param
==
nullptr
)
{
/* no configuration: default to syslog (if
available) */
...
...
src/LogInit.hxx
View file @
0b4e0b7b
...
...
@@ -20,6 +20,8 @@
#ifndef MPD_LOG_INIT_HXX
#define MPD_LOG_INIT_HXX
struct
ConfigData
;
/**
* Configure a logging destination for daemon startup, before the
* configuration file is read. This allows the daemon to use the
...
...
@@ -35,7 +37,7 @@ log_early_init(bool verbose);
* Throws #std::runtime_error on error.
*/
void
log_init
(
bool
verbose
,
bool
use_stdout
);
log_init
(
const
ConfigData
&
config
,
bool
verbose
,
bool
use_stdout
);
void
log_deinit
();
...
...
src/Main.cxx
View file @
0b4e0b7b
...
...
@@ -509,7 +509,7 @@ try {
TagLoadConfig
(
raw_config
);
log_init
(
options
.
verbose
,
options
.
log_stderr
);
log_init
(
raw_config
,
options
.
verbose
,
options
.
log_stderr
);
instance
=
new
Instance
();
...
...
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