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
c843bce9
Commit
c843bce9
authored
Sep 23, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LogLevel: rename DEFAULT to NOTICE
"DEFAULT" is a bad name - all it says is that it's the default value, but it doesn't say what it means. The name NOTICE mimics the syslog level.
parent
e3106a01
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
60 additions
and
58 deletions
+60
-58
mpd.conf.5.rst
doc/mpd.conf.5.rst
+2
-2
mpdconf.example
doc/mpdconf.example
+1
-1
Log.cxx
src/Log.cxx
+2
-2
Log.hxx
src/Log.hxx
+3
-3
LogBackend.cxx
src/LogBackend.cxx
+3
-3
LogInit.cxx
src/LogInit.cxx
+5
-3
LogLevel.hxx
src/LogLevel.hxx
+1
-1
Main.cxx
src/Main.cxx
+6
-6
Archive.cxx
src/db/update/Archive.cxx
+2
-2
Container.cxx
src/db/update/Container.cxx
+3
-3
Remove.cxx
src/db/update/Remove.cxx
+1
-1
UpdateSong.cxx
src/db/update/UpdateSong.cxx
+4
-4
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+7
-7
Init.cxx
src/output/Init.cxx
+7
-7
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+1
-1
WasapiOutputPlugin.cxx
src/output/plugins/WasapiOutputPlugin.cxx
+2
-2
Thread.cxx
src/player/Thread.cxx
+2
-2
ZeroconfAvahi.cxx
src/zeroconf/ZeroconfAvahi.cxx
+8
-8
No files found.
doc/mpd.conf.5.rst
View file @
c843bce9
...
...
@@ -83,12 +83,12 @@ log_level <default, secure, or verbose>
- :samp:`error`: errors
- :samp:`warning`: warnings
- :samp:`
default
`: interesting informational messages
- :samp:`
notice
`: interesting informational messages
- :samp:`info`: unimportant informational messages
- :samp:`verbose`: debug messages (for developers and for
troubleshooting)
The default is :samp:`
default
`.
The default is :samp:`
notice
`.
follow_outside_symlinks <yes or no>
Control if MPD will follow symbolic links pointing outside the music dir. You
...
...
doc/mpdconf.example
View file @
c843bce9
...
...
@@ -92,7 +92,7 @@
# Suppress all messages below the given threshold. Use "verbose" for
# troubleshooting.
#
#log_level "
default
"
#log_level "
notice
"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
...
...
src/Log.cxx
View file @
c843bce9
...
...
@@ -65,11 +65,11 @@ FormatInfo(const Domain &domain, const char *fmt, ...) noexcept
}
void
Format
Default
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
noexcept
Format
Notice
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
noexcept
{
std
::
va_list
ap
;
va_start
(
ap
,
fmt
);
LogFormatV
(
LogLevel
::
DEFAULT
,
domain
,
fmt
,
ap
);
LogFormatV
(
LogLevel
::
NOTICE
,
domain
,
fmt
,
ap
);
va_end
(
ap
);
}
...
...
src/Log.hxx
View file @
c843bce9
...
...
@@ -77,14 +77,14 @@ void
FormatInfo
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
noexcept
;
static
inline
void
Log
Default
(
const
Domain
&
domain
,
const
char
*
msg
)
noexcept
Log
Notice
(
const
Domain
&
domain
,
const
char
*
msg
)
noexcept
{
Log
(
LogLevel
::
DEFAULT
,
domain
,
msg
);
Log
(
LogLevel
::
NOTICE
,
domain
,
msg
);
}
gcc_printf
(
2
,
3
)
void
Format
Default
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
noexcept
;
Format
Notice
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
noexcept
;
static
inline
void
LogWarning
(
const
Domain
&
domain
,
const
char
*
msg
)
noexcept
...
...
src/LogBackend.cxx
View file @
c843bce9
...
...
@@ -47,7 +47,7 @@ ToAndroidLogLevel(LogLevel log_level) noexcept
return
ANDROID_LOG_DEBUG
;
case
LogLevel
:
:
INFO
:
case
LogLevel
:
:
DEFAULT
:
case
LogLevel
:
:
NOTICE
:
return
ANDROID_LOG_INFO
;
case
LogLevel
:
:
WARNING
:
...
...
@@ -63,7 +63,7 @@ ToAndroidLogLevel(LogLevel log_level) noexcept
#else
static
LogLevel
log_threshold
=
LogLevel
::
DEFAULT
;
static
LogLevel
log_threshold
=
LogLevel
::
NOTICE
;
static
bool
enable_timestamp
;
...
...
@@ -122,7 +122,7 @@ ToSysLogLevel(LogLevel log_level) noexcept
case
LogLevel
:
:
INFO
:
return
LOG_INFO
;
case
LogLevel
:
:
DEFAULT
:
case
LogLevel
:
:
NOTICE
:
return
LOG_NOTICE
;
case
LogLevel
:
:
WARNING
:
...
...
src/LogInit.cxx
View file @
c843bce9
...
...
@@ -95,8 +95,10 @@ log_init_file(int line)
static
inline
LogLevel
parse_log_level
(
const
char
*
value
)
{
if
(
StringIsEqual
(
value
,
"default"
))
return
LogLevel
::
DEFAULT
;
if
(
StringIsEqual
(
value
,
"notice"
)
||
/* deprecated name: */
StringIsEqual
(
value
,
"default"
))
return
LogLevel
::
NOTICE
;
else
if
(
StringIsEqual
(
value
,
"info"
)
||
/* deprecated since MPD 0.22: */
StringIsEqual
(
value
,
"secure"
))
...
...
@@ -141,7 +143,7 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout)
SetLogThreshold
(
config
.
With
(
ConfigOption
::
LOG_LEVEL
,
[](
const
char
*
s
){
return
s
!=
nullptr
?
parse_log_level
(
s
)
:
LogLevel
::
DEFAULT
;
:
LogLevel
::
NOTICE
;
}));
if
(
use_stdout
)
{
...
...
src/LogLevel.hxx
View file @
c843bce9
...
...
@@ -42,7 +42,7 @@ enum class LogLevel {
/**
* Interesting informational message.
*/
DEFAULT
,
NOTICE
,
/**
* Warning: something may be wrong.
...
...
src/Main.cxx
View file @
c843bce9
...
...
@@ -194,16 +194,16 @@ glue_db_init_and_load(Instance &instance, const ConfigData &config)
config
);
if
(
instance
.
storage
==
nullptr
)
{
Log
Default
(
config_domain
,
"Found database setting without "
"music_directory - disabling database"
);
Log
Notice
(
config_domain
,
"Found database setting without "
"music_directory - disabling database"
);
return
true
;
}
}
else
{
if
(
IsStorageConfigured
(
config
))
Log
Default
(
config_domain
,
"Ignoring the storage configuration "
"because the database does not need it"
);
Log
Notice
(
config_domain
,
"Ignoring the storage configuration "
"because the database does not need it"
);
}
try
{
...
...
src/db/update/Archive.cxx
View file @
c843bce9
...
...
@@ -82,8 +82,8 @@ UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
}
modified
=
true
;
Format
Default
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
Format
Notice
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
}
}
else
{
if
(
!
song
->
UpdateFileInArchive
(
archive
))
{
...
...
src/db/update/Container.cxx
View file @
c843bce9
...
...
@@ -75,9 +75,9 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
// shouldn't be necessary but it's there..
song
->
mtime
=
info
.
mtime
;
Format
Default
(
update_domain
,
"added %s/%s"
,
contdir
->
GetPath
(),
song
->
filename
.
c_str
());
Format
Notice
(
update_domain
,
"added %s/%s"
,
contdir
->
GetPath
(),
song
->
filename
.
c_str
());
{
const
ScopeDatabaseLock
protect
;
...
...
src/db/update/Remove.cxx
View file @
c843bce9
...
...
@@ -41,7 +41,7 @@ UpdateRemoveService::RunDeferred() noexcept
}
for
(
const
auto
&
uri
:
copy
)
{
Format
Default
(
update_domain
,
"removing %s"
,
uri
.
c_str
());
Format
Notice
(
update_domain
,
"removing %s"
,
uri
.
c_str
());
listener
.
OnDatabaseSongRemoved
(
uri
.
c_str
());
}
...
...
src/db/update/UpdateSong.cxx
View file @
c843bce9
...
...
@@ -76,11 +76,11 @@ try {
}
modified
=
true
;
Format
Default
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
Format
Notice
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
}
else
if
(
info
.
mtime
!=
song
->
mtime
||
walk_discard
)
{
Format
Default
(
update_domain
,
"updating %s/%s"
,
directory
.
GetPath
(),
name
);
Format
Notice
(
update_domain
,
"updating %s/%s"
,
directory
.
GetPath
(),
name
);
if
(
!
song
->
UpdateFile
(
storage
))
{
FormatDebug
(
update_domain
,
"deleting unrecognized file %s/%s"
,
...
...
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
c843bce9
...
...
@@ -364,17 +364,17 @@ faad_stream_decode(DecoderClient &client, InputStream &is,
}
if
(
frame_info
.
channels
!=
audio_format
.
channels
)
{
Format
Default
(
faad_decoder_domain
,
"channel count changed from %u to %u"
,
audio_format
.
channels
,
frame_info
.
channels
);
Format
Notice
(
faad_decoder_domain
,
"channel count changed from %u to %u"
,
audio_format
.
channels
,
frame_info
.
channels
);
break
;
}
if
(
frame_info
.
samplerate
!=
audio_format
.
sample_rate
)
{
Format
Default
(
faad_decoder_domain
,
"sample rate changed from %u to %lu"
,
audio_format
.
sample_rate
,
(
unsigned
long
)
frame_info
.
samplerate
);
Format
Notice
(
faad_decoder_domain
,
"sample rate changed from %u to %lu"
,
audio_format
.
sample_rate
,
(
unsigned
long
)
frame_info
.
samplerate
);
break
;
}
...
...
src/output/Init.cxx
View file @
c843bce9
...
...
@@ -62,15 +62,15 @@ FilteredAudioOutput::FilteredAudioOutput(const char *_plugin_name,
static
const
AudioOutputPlugin
*
audio_output_detect
()
{
Log
Default
(
output_domain
,
"Attempt to detect audio output device"
);
Log
Info
(
output_domain
,
"Attempt to detect audio output device"
);
audio_output_plugins_for_each
(
plugin
)
{
if
(
plugin
->
test_default_device
==
nullptr
)
continue
;
Format
Default
(
output_domain
,
"Attempting to detect a %s audio device"
,
plugin
->
name
);
Format
Info
(
output_domain
,
"Attempting to detect a %s audio device"
,
plugin
->
name
);
if
(
ao_plugin_test_default_device
(
plugin
))
return
plugin
;
}
...
...
@@ -289,9 +289,9 @@ audio_output_new(EventLoop &event_loop,
plugin
=
audio_output_detect
();
Format
Default
(
output_domain
,
"Successfully detected a %s audio device"
,
plugin
->
name
);
Format
Notice
(
output_domain
,
"Successfully detected a %s audio device"
,
plugin
->
name
);
}
std
::
unique_ptr
<
AudioOutput
>
ao
(
ao_plugin_init
(
event_loop
,
*
plugin
,
...
...
src/output/plugins/JackOutputPlugin.cxx
View file @
c843bce9
...
...
@@ -376,7 +376,7 @@ mpd_jack_error(const char *msg)
static
void
mpd_jack_info
(
const
char
*
msg
)
{
Log
Default
(
jack_output_domain
,
msg
);
Log
Notice
(
jack_output_domain
,
msg
);
}
#endif
...
...
src/output/plugins/WasapiOutputPlugin.cxx
View file @
c843bce9
...
...
@@ -322,8 +322,8 @@ void WasapiOutput::Enable() {
if
(
enumerate_devices
&&
SafeTry
([
this
]()
{
EnumerateDevices
();
}))
{
for
(
const
auto
&
desc
:
device_desc
)
{
Format
Default
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
desc
.
first
,
desc
.
second
.
c_str
());
Format
Notice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
desc
.
first
,
desc
.
second
.
c_str
());
}
}
...
...
src/player/Thread.cxx
View file @
c843bce9
...
...
@@ -964,7 +964,7 @@ Player::SongBorder() noexcept
{
const
ScopeUnlock
unlock
(
pc
.
mutex
);
Format
Default
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
Format
Notice
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
ReplacePipe
(
dc
.
pipe
);
...
...
@@ -1135,7 +1135,7 @@ Player::Run() noexcept
cross_fade_tag
.
reset
();
if
(
song
!=
nullptr
)
{
Format
Default
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
Format
Notice
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
song
.
reset
();
}
...
...
src/zeroconf/ZeroconfAvahi.cxx
View file @
c843bce9
...
...
@@ -59,9 +59,9 @@ AvahiGroupCallback(AvahiEntryGroup *g,
switch
(
state
)
{
case
AVAHI_ENTRY_GROUP_ESTABLISHED
:
/* The entry group has been established successfully */
Format
Default
(
avahi_domain
,
"Service '%s' successfully established."
,
avahi_name
);
Format
Notice
(
avahi_domain
,
"Service '%s' successfully established."
,
avahi_name
);
break
;
case
AVAHI_ENTRY_GROUP_COLLISION
:
...
...
@@ -72,9 +72,9 @@ AvahiGroupCallback(AvahiEntryGroup *g,
avahi_name
=
n
;
}
Format
Default
(
avahi_domain
,
"Service name collision, renaming service to '%s'"
,
avahi_name
);
Format
Notice
(
avahi_domain
,
"Service name collision, renaming service to '%s'"
,
avahi_name
);
/* And recreate the services */
AvahiRegisterService
(
avahi_entry_group_get_client
(
g
));
...
...
@@ -171,8 +171,8 @@ MyAvahiClientCallback(AvahiClient *c, AvahiClientState state,
case
AVAHI_CLIENT_FAILURE
:
reason
=
avahi_client_errno
(
c
);
if
(
reason
==
AVAHI_ERR_DISCONNECTED
)
{
Log
Default
(
avahi_domain
,
"Client Disconnected, will reconnect shortly"
);
Log
Notice
(
avahi_domain
,
"Client Disconnected, will reconnect shortly"
);
if
(
avahi_group
!=
nullptr
)
{
avahi_entry_group_free
(
avahi_group
);
avahi_group
=
nullptr
;
...
...
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