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
ecf12a60
Commit
ecf12a60
authored
Nov 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log: add level "DEFAULT"
Map LogLevel::INFO to G_LOG_LEVEL_INFO, and LogLevel::DEFAULT to G_LOG_LEVEL_MESSAGE. Now client connect/disconnect message are only logged on log_level "secure".
parent
6de85cb0
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
47 additions
and
20 deletions
+47
-20
Log.cxx
src/Log.cxx
+12
-0
Log.hxx
src/Log.hxx
+15
-0
Main.cxx
src/Main.cxx
+3
-3
OutputInit.cxx
src/OutputInit.cxx
+3
-3
PlayerThread.cxx
src/PlayerThread.cxx
+1
-1
UpdateArchive.cxx
src/UpdateArchive.cxx
+1
-1
UpdateContainer.cxx
src/UpdateContainer.cxx
+1
-1
UpdateRemove.cxx
src/UpdateRemove.cxx
+1
-1
UpdateSong.cxx
src/UpdateSong.cxx
+2
-2
ZeroconfAvahi.cxx
src/ZeroconfAvahi.cxx
+3
-3
ZeroconfGlue.cxx
src/ZeroconfGlue.cxx
+1
-1
FaadDecoderPlugin.cxx
src/decoder/FaadDecoderPlugin.cxx
+2
-2
FfmpegDecoderPlugin.cxx
src/decoder/FfmpegDecoderPlugin.cxx
+1
-1
JackOutputPlugin.cxx
src/output/JackOutputPlugin.cxx
+1
-1
No files found.
src/Log.cxx
View file @
ecf12a60
...
...
@@ -51,6 +51,9 @@ ToGLib(LogLevel level)
return
G_LOG_LEVEL_DEBUG
;
case
LogLevel
:
:
INFO
:
return
G_LOG_LEVEL_INFO
;
case
LogLevel
:
:
DEFAULT
:
return
G_LOG_LEVEL_MESSAGE
;
case
LogLevel
:
:
WARNING
:
...
...
@@ -102,6 +105,15 @@ FormatInfo(const Domain &domain, const char *fmt, ...)
}
void
FormatDefault
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
LogFormatV
(
domain
,
LogLevel
::
DEFAULT
,
fmt
,
ap
);
va_end
(
ap
);
}
void
FormatWarning
(
const
Domain
&
domain
,
const
char
*
fmt
,
...)
{
va_list
ap
;
...
...
src/Log.hxx
View file @
ecf12a60
...
...
@@ -45,6 +45,11 @@ enum class LogLevel {
INFO
,
/**
* Interesting informational message.
*/
DEFAULT
,
/**
* Warning: something may be wrong.
*/
WARNING
,
...
...
@@ -84,6 +89,16 @@ void
FormatInfo
(
const
Domain
&
domain
,
const
char
*
fmt
,
...);
static
inline
void
LogDefault
(
const
Domain
&
domain
,
const
char
*
msg
)
{
Log
(
domain
,
LogLevel
::
DEFAULT
,
msg
);
}
gcc_printf
(
2
,
3
)
void
FormatDefault
(
const
Domain
&
domain
,
const
char
*
fmt
,
...);
static
inline
void
LogWarning
(
const
Domain
&
domain
,
const
char
*
msg
)
{
Log
(
domain
,
LogLevel
::
WARNING
,
msg
);
...
...
src/Main.cxx
View file @
ecf12a60
...
...
@@ -160,16 +160,16 @@ glue_db_init_and_load(void)
const
struct
config_param
*
path
=
config_get_param
(
CONF_DB_FILE
);
if
(
param
!=
nullptr
&&
path
!=
nullptr
)
Log
Info
(
main_domain
,
Log
Warning
(
main_domain
,
"Found both 'database' and 'db_file' setting - ignoring the latter"
);
if
(
!
mapper_has_music_directory
())
{
if
(
param
!=
nullptr
)
Log
Info
(
main_domain
,
Log
Default
(
main_domain
,
"Found database setting without "
"music_directory - disabling database"
);
if
(
path
!=
nullptr
)
Log
Info
(
main_domain
,
Log
Default
(
main_domain
,
"Found db_file setting without "
"music_directory - disabling database"
);
return
true
;
...
...
src/OutputInit.cxx
View file @
ecf12a60
...
...
@@ -50,13 +50,13 @@
static
const
struct
audio_output_plugin
*
audio_output_detect
(
Error
&
error
)
{
Log
Info
(
output_domain
,
"Attempt to detect audio output device"
);
Log
Default
(
output_domain
,
"Attempt to detect audio output device"
);
audio_output_plugins_for_each
(
plugin
)
{
if
(
plugin
->
test_default_device
==
nullptr
)
continue
;
Format
Info
(
output_domain
,
Format
Default
(
output_domain
,
"Attempting to detect a %s audio device"
,
plugin
->
name
);
if
(
ao_plugin_test_default_device
(
plugin
))
...
...
@@ -310,7 +310,7 @@ audio_output_new(const config_param ¶m,
if
(
plugin
==
nullptr
)
return
nullptr
;
Format
Info
(
output_domain
,
Format
Default
(
output_domain
,
"Successfully detected a %s audio device"
,
plugin
->
name
);
}
...
...
src/PlayerThread.cxx
View file @
ecf12a60
...
...
@@ -875,7 +875,7 @@ Player::SongBorder()
{
const
auto
uri
=
song
->
GetURI
();
Format
Info
(
player_domain
,
"played
\"
%s
\"
"
,
uri
.
c_str
());
Format
Default
(
player_domain
,
"played
\"
%s
\"
"
,
uri
.
c_str
());
}
ReplacePipe
(
dc
.
pipe
);
...
...
src/UpdateArchive.cxx
View file @
ecf12a60
...
...
@@ -71,7 +71,7 @@ update_archive_tree(Directory &directory, const char *name)
db_unlock
();
modified
=
true
;
Format
Info
(
update_domain
,
"added %s/%s"
,
Format
Default
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
}
}
...
...
src/UpdateContainer.cxx
View file @
ecf12a60
...
...
@@ -112,7 +112,7 @@ update_container_file(Directory &directory,
modified
=
true
;
Format
Info
(
update_domain
,
"added %s/%s"
,
Format
Default
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
vtrack
);
g_free
(
vtrack
);
}
...
...
src/UpdateRemove.cxx
View file @
ecf12a60
...
...
@@ -52,7 +52,7 @@ song_remove_event(void)
{
const
auto
uri
=
removed_song
->
GetURI
();
Format
Info
(
update_domain
,
"removing %s"
,
uri
.
c_str
());
Format
Default
(
update_domain
,
"removing %s"
,
uri
.
c_str
());
}
#ifdef ENABLE_SQLITE
...
...
src/UpdateSong.cxx
View file @
ecf12a60
...
...
@@ -83,10 +83,10 @@ update_song_file2(Directory &directory,
db_unlock
();
modified
=
true
;
Format
Info
(
update_domain
,
"added %s/%s"
,
Format
Default
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
name
);
}
else
if
(
st
->
st_mtime
!=
song
->
mtime
||
walk_discard
)
{
Format
Info
(
update_domain
,
"updating %s/%s"
,
Format
Default
(
update_domain
,
"updating %s/%s"
,
directory
.
GetPath
(),
name
);
if
(
!
song
->
UpdateFile
())
{
FormatDebug
(
update_domain
,
...
...
src/ZeroconfAvahi.cxx
View file @
ecf12a60
...
...
@@ -61,7 +61,7 @@ static void avahiGroupCallback(AvahiEntryGroup * g,
switch
(
state
)
{
case
AVAHI_ENTRY_GROUP_ESTABLISHED
:
/* The entry group has been established successfully */
Format
Info
(
avahi_domain
,
Format
Default
(
avahi_domain
,
"Service '%s' successfully established."
,
avahiName
);
break
;
...
...
@@ -72,7 +72,7 @@ static void avahiGroupCallback(AvahiEntryGroup * g,
avahi_free
(
avahiName
);
avahiName
=
n
;
Format
Info
(
avahi_domain
,
Format
Default
(
avahi_domain
,
"Service name collision, renaming service to '%s'"
,
avahiName
);
...
...
@@ -169,7 +169,7 @@ static void avahiClientCallback(AvahiClient * c, AvahiClientState state,
case
AVAHI_CLIENT_FAILURE
:
reason
=
avahi_client_errno
(
c
);
if
(
reason
==
AVAHI_ERR_DISCONNECTED
)
{
Log
Info
(
avahi_domain
,
Log
Default
(
avahi_domain
,
"Client Disconnected, will reconnect shortly"
);
if
(
avahiGroup
)
{
avahi_entry_group_free
(
avahiGroup
);
...
...
src/ZeroconfGlue.cxx
View file @
ecf12a60
...
...
@@ -50,7 +50,7 @@ ZeroconfInit(gcc_unused EventLoop &loop)
return
;
if
(
listen_port
<=
0
)
{
Log
Info
(
zeroconf_domain
,
Log
Warning
(
zeroconf_domain
,
"No global port, disabling zeroconf"
);
zeroconfEnabled
=
false
;
return
;
...
...
src/decoder/FaadDecoderPlugin.cxx
View file @
ecf12a60
...
...
@@ -427,14 +427,14 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
}
if
(
frame_info
.
channels
!=
audio_format
.
channels
)
{
Format
Info
(
faad_decoder_domain
,
Format
Default
(
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
Info
(
faad_decoder_domain
,
Format
Default
(
faad_decoder_domain
,
"sample rate changed from %u to %lu"
,
audio_format
.
sample_rate
,
(
unsigned
long
)
frame_info
.
samplerate
);
...
...
src/decoder/FfmpegDecoderPlugin.cxx
View file @
ecf12a60
...
...
@@ -282,7 +282,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
if
(
len
<
0
)
{
/* if error, we skip the frame */
Log
Info
(
ffmpeg_domain
,
Log
Default
(
ffmpeg_domain
,
"decoding failed, frame skipped"
);
break
;
}
...
...
src/output/JackOutputPlugin.cxx
View file @
ecf12a60
...
...
@@ -221,7 +221,7 @@ mpd_jack_error(const char *msg)
static
void
mpd_jack_info
(
const
char
*
msg
)
{
Log
Info
(
jack_output_domain
,
msg
);
Log
Default
(
jack_output_domain
,
msg
);
}
#endif
...
...
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