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
6f539cfc
Commit
6f539cfc
authored
Jun 24, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partition, ...: use libfmt for logging
parent
0185d58a
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
320 additions
and
296 deletions
+320
-296
meson.build
meson.build
+0
-1
LogInit.cxx
src/LogInit.cxx
+4
-4
Main.cxx
src/Main.cxx
+4
-5
Partition.cxx
src/Partition.cxx
+5
-3
StateFile.cxx
src/StateFile.cxx
+6
-6
Event.cxx
src/client/Event.cxx
+3
-1
New.cxx
src/client/New.cxx
+3
-3
Process.cxx
src/client/Process.cxx
+24
-25
Check.cxx
src/config/Check.cxx
+3
-3
File.cxx
src/config/File.cxx
+7
-7
Archive.cxx
src/db/update/Archive.cxx
+9
-8
Container.cxx
src/db/update/Container.cxx
+3
-3
InotifyQueue.cxx
src/db/update/InotifyQueue.cxx
+8
-5
InotifyUpdate.cxx
src/db/update/InotifyUpdate.cxx
+5
-3
Playlist.cxx
src/db/update/Playlist.cxx
+5
-3
Remove.cxx
src/db/update/Remove.cxx
+1
-1
UpdateSong.cxx
src/db/update/UpdateSong.cxx
+19
-18
Walk.cxx
src/db/update/Walk.cxx
+4
-4
DecoderList.cxx
src/decoder/DecoderList.cxx
+7
-5
meson.build
src/decoder/meson.build
+1
-0
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+10
-10
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+17
-17
MikmodDecoderPlugin.cxx
src/decoder/plugins/MikmodDecoderPlugin.cxx
+6
-7
Mpg123DecoderPlugin.cxx
src/decoder/plugins/Mpg123DecoderPlugin.cxx
+18
-18
ServerSocket.cxx
src/event/ServerSocket.cxx
+13
-11
Charset.cxx
src/fs/Charset.cxx
+2
-2
CheckFile.cxx
src/fs/CheckFile.cxx
+8
-8
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+4
-3
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+5
-5
LogError.cxx
src/lib/ffmpeg/LogError.cxx
+1
-1
LogError.cxx
src/lib/pulse/LogError.cxx
+1
-1
Volume.cxx
src/mixer/Volume.cxx
+2
-2
AlsaMixerPlugin.cxx
src/mixer/plugins/AlsaMixerPlugin.cxx
+3
-3
Control.cxx
src/output/Control.cxx
+5
-3
Filtered.cxx
src/output/Filtered.cxx
+11
-9
Init.cxx
src/output/Init.cxx
+15
-14
Thread.cxx
src/output/Thread.cxx
+19
-16
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+20
-20
SndioOutputPlugin.cxx
src/output/plugins/SndioOutputPlugin.cxx
+2
-2
SlesOutputPlugin.cxx
src/output/plugins/sles/SlesOutputPlugin.cxx
+3
-3
WasapiOutputPlugin.cxx
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+18
-20
Thread.cxx
src/player/Thread.cxx
+6
-6
StorageState.cxx
src/storage/StorageState.cxx
+9
-6
FatalError.cxx
src/system/FatalError.cxx
+1
-1
No files found.
meson.build
View file @
6f539cfc
...
...
@@ -269,7 +269,6 @@ sources = [
'src/command/CommandListBuilder.cxx',
'src/Idle.cxx',
'src/IdleFlags.cxx',
'src/decoder/Domain.cxx',
'src/decoder/Thread.cxx',
'src/decoder/Control.cxx',
'src/decoder/Bridge.cxx',
...
...
src/LogInit.cxx
View file @
6f539cfc
...
...
@@ -240,16 +240,16 @@ cycle_log_files() noexcept
fd
=
open_log_file
();
if
(
fd
<
0
)
{
const
std
::
string
out_path_utf8
=
out_path
.
ToUTF8
();
F
orma
tError
(
log_domain
,
"error re-opening log file: %s
"
,
out_path_utf8
.
c_str
()
);
F
m
tError
(
log_domain
,
"error re-opening log file: {}
"
,
out_path_utf8
);
return
-
1
;
}
redirect_logs
(
fd
);
close
(
fd
);
Format
Debug
(
log_domain
,
"Done cycling log files"
);
Log
Debug
(
log_domain
,
"Done cycling log files"
);
return
0
;
#endif
}
src/Main.cxx
View file @
6f539cfc
...
...
@@ -287,9 +287,8 @@ initialize_decoder_and_player(Instance &instance,
"positive integer"
,
s
);
if
(
result
<
MIN_BUFFER_SIZE
)
{
FormatWarning
(
config_domain
,
"buffer size %lu is too small, using %lu bytes instead"
,
(
unsigned
long
)
result
,
(
unsigned
long
)
MIN_BUFFER_SIZE
);
FmtWarning
(
config_domain
,
"buffer size {} is too small, using {} bytes instead"
,
result
,
MIN_BUFFER_SIZE
);
result
=
MIN_BUFFER_SIZE
;
}
...
...
@@ -521,8 +520,8 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
raw_config
.
GetUnsigned
(
ConfigOption
::
AUTO_UPDATE_DEPTH
,
INT_MAX
));
#else
Format
Warning
(
config_domain
,
"inotify: auto_update was disabled. enable during compilation phase"
);
Log
Warning
(
config_domain
,
"inotify: auto_update was disabled. enable during compilation phase"
);
#endif
}
#endif
...
...
src/Partition.cxx
View file @
6f539cfc
...
...
@@ -21,6 +21,7 @@
#include "Partition.hxx"
#include "Instance.hxx"
#include "Log.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "song/DetachedSong.hxx"
#include "mixer/Volume.hxx"
#include "IdleFlags.hxx"
...
...
@@ -67,13 +68,14 @@ PrefetchSong(InputCacheManager &cache, const char *uri) noexcept
if
(
cache
.
Contains
(
uri
))
return
;
F
ormatDebug
(
cache_domain
,
"Prefetch '%s
'"
,
uri
);
F
mtDebug
(
cache_domain
,
"Prefetch '{}
'"
,
uri
);
try
{
cache
.
Prefetch
(
uri
);
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Prefetch '%s' failed"
,
uri
);
FmtError
(
cache_domain
,
"Prefetch '{}' failed: {}"
,
uri
,
std
::
current_exception
());
}
}
...
...
src/StateFile.cxx
View file @
6f539cfc
...
...
@@ -93,8 +93,8 @@ StateFile::Write(OutputStream &os)
void
StateFile
::
Write
()
{
F
orma
tDebug
(
state_file_domain
,
"Saving state file %s"
,
path_utf8
.
c_str
()
);
F
m
tDebug
(
state_file_domain
,
"Saving state file {}"
,
path_utf8
);
try
{
FileOutputStream
fos
(
config
.
path
);
...
...
@@ -112,7 +112,7 @@ StateFile::Read()
try
{
bool
success
;
F
ormatDebug
(
state_file_domain
,
"Loading state file %s"
,
path_utf8
.
c_str
()
);
F
mtDebug
(
state_file_domain
,
"Loading state file {}"
,
path_utf8
);
TextFile
file
(
config
.
path
);
...
...
@@ -135,9 +135,9 @@ try {
#endif
if
(
!
success
)
F
orma
tError
(
state_file_domain
,
"Unrecognized line in state file: %s
"
,
line
);
F
m
tError
(
state_file_domain
,
"Unrecognized line in state file: {}
"
,
line
);
}
RememberVersions
();
...
...
src/client/Event.cxx
View file @
6f539cfc
...
...
@@ -18,12 +18,14 @@
*/
#include "Client.hxx"
#include "Domain.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "Log.hxx"
void
Client
::
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
{
F
ormatError
(
ep
,
"error on client %d"
,
num
);
F
mtError
(
client_domain
,
"error on client {}: {}"
,
num
,
ep
);
SetExpired
();
}
...
...
src/client/New.cxx
View file @
6f539cfc
...
...
@@ -76,8 +76,8 @@ client_new(EventLoop &loop, Partition &partition,
client_list
.
Add
(
*
client
);
partition
.
clients
.
push_back
(
*
client
);
F
ormatInfo
(
client_domain
,
"[%u] opened from %s
"
,
num
,
remote
.
c_str
()
);
F
mtInfo
(
client_domain
,
"[{}] opened from {}
"
,
num
,
remote
);
}
void
...
...
@@ -89,6 +89,6 @@ Client::Close() noexcept
if
(
FullyBufferedSocket
::
IsDefined
())
FullyBufferedSocket
::
Close
();
F
ormatInfo
(
client_domain
,
"[%u
] closed"
,
num
);
F
mtInfo
(
client_domain
,
"[{}
] closed"
,
num
);
delete
this
;
}
src/client/Process.cxx
View file @
6f539cfc
...
...
@@ -39,9 +39,9 @@ Client::ProcessCommandList(bool list_ok,
for
(
auto
&&
i
:
list
)
{
char
*
cmd
=
&*
i
.
begin
();
F
ormatDebug
(
client_domain
,
"process command
\"
%s
\"
"
,
cmd
);
F
mtDebug
(
client_domain
,
"process command
\"
{}
\"
"
,
cmd
);
auto
ret
=
command_process
(
*
this
,
n
++
,
cmd
);
F
ormatDebug
(
client_domain
,
"command returned %i"
,
int
(
ret
));
F
mtDebug
(
client_domain
,
"command returned {}"
,
unsigned
(
ret
));
if
(
IsExpired
())
return
CommandResult
::
CLOSE
;
else
if
(
ret
!=
CommandResult
::
OK
)
...
...
@@ -62,9 +62,9 @@ Client::ProcessLine(char *line) noexcept
/* all valid MPD commands begin with a lower case
letter; this could be a badly routed HTTP
request */
F
orma
tWarning
(
client_domain
,
"[%u] malformed command
\"
%s
\"
"
,
num
,
line
);
F
m
tWarning
(
client_domain
,
"[{}] malformed command
\"
{}
\"
"
,
num
,
line
);
return
CommandResult
::
CLOSE
;
}
...
...
@@ -83,9 +83,9 @@ Client::ProcessLine(char *line) noexcept
}
else
if
(
idle_waiting
)
{
/* during idle mode, clients must not send anything
except "noidle" */
F
orma
tWarning
(
client_domain
,
"[%u] command
\"
%s
\"
during idle"
,
num
,
line
);
F
m
tWarning
(
client_domain
,
"[{}] command
\"
{}
\"
during idle"
,
num
,
line
);
return
CommandResult
::
CLOSE
;
}
...
...
@@ -93,9 +93,9 @@ Client::ProcessLine(char *line) noexcept
if
(
StringIsEqual
(
line
,
CLIENT_LIST_MODE_END
))
{
const
unsigned
id
=
num
;
F
orma
tDebug
(
client_domain
,
"[%u
] process command list"
,
id
);
F
m
tDebug
(
client_domain
,
"[{}
] process command list"
,
id
);
const
bool
ok_mode
=
cmd_list
.
IsOKMode
();
auto
list
=
cmd_list
.
Commit
();
...
...
@@ -103,9 +103,9 @@ Client::ProcessLine(char *line) noexcept
auto
ret
=
ProcessCommandList
(
ok_mode
,
std
::
move
(
list
));
F
orma
tDebug
(
client_domain
,
"[%u
] process command "
"list returned %i"
,
id
,
int
(
ret
));
F
m
tDebug
(
client_domain
,
"[{}
] process command "
"list returned {}"
,
id
,
unsigned
(
ret
));
if
(
ret
==
CommandResult
::
OK
)
command_success
(
*
this
);
...
...
@@ -113,11 +113,10 @@ Client::ProcessLine(char *line) noexcept
return
ret
;
}
else
{
if
(
!
cmd_list
.
Add
(
line
))
{
FormatWarning
(
client_domain
,
"[%u] command list size "
"is larger than the max (%lu)"
,
num
,
(
unsigned
long
)
client_max_command_list_size
);
FmtWarning
(
client_domain
,
"[{}] command list size "
"is larger than the max ({})"
,
num
,
client_max_command_list_size
);
return
CommandResult
::
CLOSE
;
}
...
...
@@ -133,13 +132,13 @@ Client::ProcessLine(char *line) noexcept
}
else
{
const
unsigned
id
=
num
;
F
orma
tDebug
(
client_domain
,
"[%u] process command
\"
%s
\"
"
,
id
,
line
);
F
m
tDebug
(
client_domain
,
"[{}] process command
\"
{}
\"
"
,
id
,
line
);
auto
ret
=
command_process
(
*
this
,
0
,
line
);
F
orma
tDebug
(
client_domain
,
"[%u] command returned %i
"
,
id
,
int
(
ret
));
F
m
tDebug
(
client_domain
,
"[{}] command returned {}
"
,
id
,
unsigned
(
ret
));
if
(
IsExpired
())
return
CommandResult
::
CLOSE
;
...
...
src/config/Check.cxx
View file @
6f539cfc
...
...
@@ -33,9 +33,9 @@ Check(const ConfigBlock &block)
for
(
const
auto
&
i
:
block
.
block_params
)
{
if
(
!
i
.
used
)
F
orma
tWarning
(
config_domain
,
"option '%s' on line %i
was not recognized"
,
i
.
name
.
c_str
()
,
i
.
line
);
F
m
tWarning
(
config_domain
,
"option '{}' on line {}
was not recognized"
,
i
.
name
,
i
.
line
);
}
}
...
...
src/config/File.cxx
View file @
6f539cfc
...
...
@@ -116,9 +116,9 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader,
const
ConfigTemplate
&
option
=
config_block_templates
[
i
];
if
(
option
.
deprecated
)
F
orma
tWarning
(
config_file_domain
,
"config parameter
\"
%s
\"
on line %u
is deprecated"
,
name
,
reader
.
GetLineNumber
());
F
m
tWarning
(
config_file_domain
,
"config parameter
\"
{}
\"
on line {}
is deprecated"
,
name
,
reader
.
GetLineNumber
());
if
(
!
option
.
repeatable
)
if
(
const
auto
*
block
=
config_data
.
GetBlock
(
o
))
...
...
@@ -148,9 +148,9 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
const
ConfigTemplate
&
option
=
config_param_templates
[
i
];
if
(
option
.
deprecated
)
F
orma
tWarning
(
config_file_domain
,
"config parameter
\"
%s
\"
on line %u
is deprecated"
,
name
,
reader
.
GetLineNumber
());
F
m
tWarning
(
config_file_domain
,
"config parameter
\"
{}
\"
on line {}
is deprecated"
,
name
,
reader
.
GetLineNumber
());
if
(
!
option
.
repeatable
)
/* if the option is not repeatable, override the old
...
...
@@ -238,7 +238,7 @@ ReadConfigFile(ConfigData &config_data, Path path)
assert
(
!
path
.
IsNull
());
const
std
::
string
path_utf8
=
path
.
ToUTF8
();
F
ormatDebug
(
config_file_domain
,
"loading file %s"
,
path_utf8
.
c_str
()
);
F
mtDebug
(
config_file_domain
,
"loading file {}"
,
path_utf8
);
FileReader
file
(
path
);
...
...
src/db/update/Archive.cxx
View file @
6f539cfc
...
...
@@ -23,6 +23,7 @@
#include "db/plugins/simple/Directory.hxx"
#include "db/plugins/simple/Song.hxx"
#include "storage/StorageInterface.hxx"
#include "lib/fmt/PathFormatter.hxx"
#include "fs/AllocatedPath.hxx"
#include "storage/FileInfo.hxx"
#include "archive/ArchiveList.hxx"
...
...
@@ -82,14 +83,14 @@ UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
}
modified
=
true
;
F
ormatNotice
(
update_domain
,
"added %s/%s
"
,
directory
.
GetPath
(),
name
);
F
mtNotice
(
update_domain
,
"added {}/{}
"
,
directory
.
GetPath
(),
name
);
}
}
else
{
if
(
!
song
->
UpdateFileInArchive
(
archive
))
{
F
orma
tDebug
(
update_domain
,
"deleting unrecognized file %s/%s
"
,
directory
.
GetPath
(),
name
);
F
m
tDebug
(
update_domain
,
"deleting unrecognized file {}/{}
"
,
directory
.
GetPath
(),
name
);
editor
.
LockDeleteSong
(
directory
,
song
);
}
}
...
...
@@ -107,8 +108,8 @@ class UpdateArchiveVisitor final : public ArchiveVisitor {
:
walk
(
_walk
),
archive
(
_archive
),
directory
(
_directory
)
{}
void
VisitArchiveEntry
(
const
char
*
path_utf8
)
override
{
F
orma
tDebug
(
update_domain
,
"adding archive file: %s
"
,
path_utf8
);
F
m
tDebug
(
update_domain
,
"adding archive file: {}
"
,
path_utf8
);
walk
.
UpdateArchiveTree
(
archive
,
directory
,
path_utf8
);
}
};
...
...
@@ -149,7 +150,7 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, std::string_view name,
return
;
}
F
ormatDebug
(
update_domain
,
"archive %s opened"
,
path_fs
.
c_str
()
);
F
mtDebug
(
update_domain
,
"archive {} opened"
,
path_fs
);
UpdateArchiveVisitor
visitor
(
*
this
,
*
file
,
*
directory
);
file
->
Visit
(
visitor
);
...
...
src/db/update/Container.cxx
View file @
6f539cfc
...
...
@@ -75,9 +75,9 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
// shouldn't be necessary but it's there..
song
->
mtime
=
info
.
mtime
;
F
ormatNotice
(
update_domain
,
"added %s/%s
"
,
contdir
->
GetPath
(),
song
->
filename
.
c_str
()
);
F
mtNotice
(
update_domain
,
"added {}/{}
"
,
contdir
->
GetPath
(),
song
->
filename
);
{
const
ScopeDatabaseLock
protect
;
...
...
src/db/update/InotifyQueue.cxx
View file @
6f539cfc
...
...
@@ -20,9 +20,11 @@
#include "InotifyQueue.hxx"
#include "InotifyDomain.hxx"
#include "Service.hxx"
#include "Log.hxx"
#include "UpdateDomain.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "protocol/Ack.hxx" // for class ProtocolError
#include "util/StringCompare.hxx"
#include "Log.hxx"
/**
* Wait this long after the last change before calling
...
...
@@ -53,14 +55,15 @@ InotifyQueue::OnDelay() noexcept
throw
;
}
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to enqueue '%s'"
,
uri_utf8
);
FmtError
(
update_domain
,
"Failed to enqueue '{}': {}"
,
uri_utf8
,
std
::
current_exception
());
queue
.
pop_front
();
continue
;
}
F
ormatDebug
(
inotify_domain
,
"updating '%s' job=%u
"
,
uri_utf8
,
id
);
F
mtDebug
(
inotify_domain
,
"updating '{}' job={}
"
,
uri_utf8
,
id
);
queue
.
pop_front
();
}
...
...
src/db/update/InotifyUpdate.cxx
View file @
6f539cfc
...
...
@@ -22,6 +22,8 @@
#include "InotifyQueue.hxx"
#include "InotifyDomain.hxx"
#include "ExcludeList.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "lib/fmt/PathFormatter.hxx"
#include "storage/StorageInterface.hxx"
#include "input/InputStream.hxx"
#include "input/Error.hxx"
...
...
@@ -223,9 +225,9 @@ try {
ret
=
inotify_source
->
Add
(
child_path_fs
.
c_str
(),
IN_MASK
);
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to register %s
"
,
child_path_fs
.
c_str
());
F
mtError
(
inotify_domain
,
"Failed to register %s: {}
"
,
child_path_fs
,
std
::
current_exception
());
continue
;
}
...
...
src/db/update/Playlist.cxx
View file @
6f539cfc
...
...
@@ -22,6 +22,7 @@
#include "db/DatabaseLock.hxx"
#include "db/PlaylistVector.hxx"
#include "db/plugins/simple/Directory.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "song/DetachedSong.hxx"
#include "input/InputStream.hxx"
#include "playlist/PlaylistPlugin.hxx"
...
...
@@ -49,7 +50,7 @@ UpdateWalk::UpdatePlaylistFile(Directory &parent, std::string_view name,
const
auto
uri_utf8
=
storage
.
MapUTF8
(
directory
->
GetPath
());
F
ormatDebug
(
update_domain
,
"scanning playlist '%s'"
,
uri_utf8
.
c_str
()
);
F
mtDebug
(
update_domain
,
"scanning playlist '{}'"
,
uri_utf8
);
try
{
Mutex
mutex
;
...
...
@@ -80,8 +81,9 @@ UpdateWalk::UpdatePlaylistFile(Directory &parent, std::string_view name,
}
}
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to scan playlist '%s'"
,
uri_utf8
.
c_str
());
FmtError
(
update_domain
,
"Failed to scan playlist '{}': {}"
,
uri_utf8
,
std
::
current_exception
());
editor
.
LockDeleteDirectory
(
directory
);
}
}
...
...
src/db/update/Remove.cxx
View file @
6f539cfc
...
...
@@ -41,7 +41,7 @@ UpdateRemoveService::RunDeferred() noexcept
}
for
(
const
auto
&
uri
:
copy
)
{
F
ormatNotice
(
update_domain
,
"removing %s"
,
uri
.
c_str
()
);
F
mtNotice
(
update_domain
,
"removing {}"
,
uri
);
listener
.
OnDatabaseSongRemoved
(
uri
.
c_str
());
}
...
...
src/db/update/UpdateSong.cxx
View file @
6f539cfc
...
...
@@ -20,6 +20,7 @@
#include "Walk.hxx"
#include "UpdateIO.hxx"
#include "UpdateDomain.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "db/DatabaseLock.hxx"
#include "db/plugins/simple/Directory.hxx"
#include "db/plugins/simple/Song.hxx"
...
...
@@ -41,9 +42,9 @@ try {
}
if
(
!
directory_child_access
(
storage
,
directory
,
name
,
R_OK
))
{
F
orma
tError
(
update_domain
,
"no read permissions on %s/%s
"
,
directory
.
GetPath
(),
name
);
F
m
tError
(
update_domain
,
"no read permissions on {}/{}
"
,
directory
.
GetPath
(),
name
);
if
(
song
!=
nullptr
)
editor
.
LockDeleteSong
(
directory
,
song
);
...
...
@@ -59,14 +60,14 @@ try {
}
if
(
song
==
nullptr
)
{
F
ormatDebug
(
update_domain
,
"reading %s/%s
"
,
directory
.
GetPath
(),
name
);
F
mtDebug
(
update_domain
,
"reading {}/{}
"
,
directory
.
GetPath
(),
name
);
auto
new_song
=
Song
::
LoadFile
(
storage
,
name
,
directory
);
if
(
!
new_song
)
{
F
orma
tDebug
(
update_domain
,
"ignoring unrecognized file %s/%s
"
,
directory
.
GetPath
(),
name
);
F
m
tDebug
(
update_domain
,
"ignoring unrecognized file {}/{}
"
,
directory
.
GetPath
(),
name
);
return
;
}
...
...
@@ -76,24 +77,24 @@ try {
}
modified
=
true
;
F
ormatNotice
(
update_domain
,
"added %s/%s
"
,
directory
.
GetPath
(),
name
);
F
mtNotice
(
update_domain
,
"added {}/{}
"
,
directory
.
GetPath
(),
name
);
}
else
if
(
info
.
mtime
!=
song
->
mtime
||
walk_discard
)
{
F
ormatNotice
(
update_domain
,
"updating %s/%s
"
,
directory
.
GetPath
(),
name
);
F
mtNotice
(
update_domain
,
"updating {}/{}
"
,
directory
.
GetPath
(),
name
);
if
(
!
song
->
UpdateFile
(
storage
))
{
F
orma
tDebug
(
update_domain
,
"deleting unrecognized file %s/%s
"
,
directory
.
GetPath
(),
name
);
F
m
tDebug
(
update_domain
,
"deleting unrecognized file {}/{}
"
,
directory
.
GetPath
(),
name
);
editor
.
LockDeleteSong
(
directory
,
song
);
}
modified
=
true
;
}
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"error reading file %s/%s
"
,
directory
.
GetPath
(),
name
);
F
mtError
(
update_domain
,
"error reading file {}/{}: {}
"
,
directory
.
GetPath
(),
name
,
std
::
current_exception
()
);
}
bool
...
...
src/db/update/Walk.cxx
View file @
6f539cfc
...
...
@@ -223,8 +223,8 @@ try {
if
(
!
UpdateDirectory
(
*
subdir
,
exclude_list
,
info
))
editor
.
LockDeleteDirectory
(
subdir
);
}
else
{
F
orma
tDebug
(
update_domain
,
"%s
is not a directory, archive or music"
,
name
);
F
m
tDebug
(
update_domain
,
"{}
is not a directory, archive or music"
,
name
);
}
}
catch
(...)
{
LogError
(
std
::
current_exception
());
...
...
@@ -520,8 +520,8 @@ UpdateWalk::Walk(Directory &root, const char *path, bool discard) noexcept
return
false
;
if
(
!
info
.
IsDirectory
())
{
F
ormatError
(
update_domain
,
"Not a directory: %s
"
,
storage
.
MapUTF8
(
""
).
c_str
(
));
F
mtError
(
update_domain
,
"Not a directory: {}
"
,
storage
.
MapUTF8
(
""
));
return
false
;
}
...
...
src/decoder/DecoderList.cxx
View file @
6f539cfc
...
...
@@ -20,9 +20,9 @@
#include "config.h"
#include "DecoderList.hxx"
#include "DecoderPlugin.hxx"
#include "Domain.hxx"
#include "decoder/Features.h"
#include "PluginUnavailable.hxx"
#include "Log.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "config/Data.hxx"
#include "config/Block.hxx"
#include "plugins/AudiofileDecoderPlugin.hxx"
...
...
@@ -49,6 +49,8 @@
#include "plugins/FluidsynthDecoderPlugin.hxx"
#include "plugins/SidplayDecoderPlugin.hxx"
#include "util/RuntimeError.hxx"
#include "Log.hxx"
#include "PluginUnavailable.hxx"
#include <iterator>
...
...
@@ -160,9 +162,9 @@ decoder_plugin_init_all(const ConfigData &config)
if
(
plugin
.
Init
(
*
param
))
decoder_plugins_enabled
[
i
]
=
true
;
}
catch
(
const
PluginUnavailable
&
e
)
{
F
ormatError
(
e
,
"Decoder plugin '%s' is unavailable
"
,
plugin
.
name
);
F
mtError
(
decoder_domain
,
"Decoder plugin '{}' is unavailable: {}
"
,
plugin
.
name
,
std
::
current_exception
()
);
}
catch
(...)
{
std
::
throw_with_nested
(
FormatRuntimeError
(
"Failed to initialize decoder plugin '%s'"
,
plugin
.
name
));
...
...
src/decoder/meson.build
View file @
6f539cfc
...
...
@@ -3,6 +3,7 @@ decoder_features = configuration_data()
decoder_api = static_library(
'decoder_api',
'DecoderAPI.cxx',
'Domain.cxx',
'Reader.cxx',
'DecoderBuffer.cxx',
'DecoderPlugin.cxx',
...
...
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
6f539cfc
...
...
@@ -357,24 +357,24 @@ faad_stream_decode(DecoderClient &client, InputStream &is,
faad_decoder_decode
(
decoder
,
buffer
,
&
frame_info
);
if
(
frame_info
.
error
>
0
)
{
F
orma
tWarning
(
faad_decoder_domain
,
"error decoding AAC stream: %s
"
,
NeAACDecGetErrorMessage
(
frame_info
.
error
));
F
m
tWarning
(
faad_decoder_domain
,
"error decoding AAC stream: {}
"
,
NeAACDecGetErrorMessage
(
frame_info
.
error
));
break
;
}
if
(
frame_info
.
channels
!=
audio_format
.
channels
)
{
F
orma
tNotice
(
faad_decoder_domain
,
"channel count changed from %u to %u
"
,
audio_format
.
channels
,
frame_info
.
channels
);
F
m
tNotice
(
faad_decoder_domain
,
"channel count changed from {} to {}
"
,
audio_format
.
channels
,
frame_info
.
channels
);
break
;
}
if
(
frame_info
.
samplerate
!=
audio_format
.
sample_rate
)
{
F
orma
tNotice
(
faad_decoder_domain
,
"sample rate changed from %u to %lu
"
,
audio_format
.
sample_rate
,
(
unsigned
long
)
frame_info
.
samplerate
);
F
m
tNotice
(
faad_decoder_domain
,
"sample rate changed from {} to {}
"
,
audio_format
.
sample_rate
,
frame_info
.
samplerate
);
break
;
}
...
...
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
6f539cfc
...
...
@@ -270,9 +270,9 @@ FfmpegReceiveFrames(DecoderClient &client, InputStream *is,
{
char
msg
[
256
];
av_strerror
(
err
,
msg
,
sizeof
(
msg
));
F
orma
tWarning
(
ffmpeg_domain
,
"avcodec_send_packet() failed: %s
"
,
msg
);
F
m
tWarning
(
ffmpeg_domain
,
"avcodec_send_packet() failed: {}
"
,
msg
);
}
return
DecoderCommand
::
STOP
;
...
...
@@ -326,8 +326,8 @@ ffmpeg_send_packet(DecoderClient &client, InputStream *is,
{
char
msg
[
256
];
av_strerror
(
err
,
msg
,
sizeof
(
msg
));
F
orma
tWarning
(
ffmpeg_domain
,
"avcodec_send_packet() failed: %s
"
,
msg
);
F
m
tWarning
(
ffmpeg_domain
,
"avcodec_send_packet() failed: {}
"
,
msg
);
}
return
DecoderCommand
::
NONE
;
...
...
@@ -355,13 +355,13 @@ ffmpeg_sample_format(enum AVSampleFormat sample_fmt) noexcept
const
char
*
name
=
av_get_sample_fmt_string
(
buffer
,
sizeof
(
buffer
),
sample_fmt
);
if
(
name
!=
nullptr
)
F
orma
tError
(
ffmpeg_domain
,
"Unsupported libavcodec SampleFormat value: %s (%d
)"
,
name
,
sample_fmt
);
F
m
tError
(
ffmpeg_domain
,
"Unsupported libavcodec SampleFormat value: {} ({}
)"
,
name
,
sample_fmt
);
else
F
orma
tError
(
ffmpeg_domain
,
"Unsupported libavcodec SampleFormat value: %d
"
,
sample_fmt
);
F
m
tError
(
ffmpeg_domain
,
"Unsupported libavcodec SampleFormat value: {}
"
,
sample_fmt
);
return
SampleFormat
::
UNDEFINED
;
}
...
...
@@ -499,8 +499,8 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
const
AVCodecDescriptor
*
codec_descriptor
=
avcodec_descriptor_get
(
codec_params
.
codec_id
);
if
(
codec_descriptor
!=
nullptr
)
F
ormatDebug
(
ffmpeg_domain
,
"codec '%s
'"
,
codec_descriptor
->
name
);
F
mtDebug
(
ffmpeg_domain
,
"codec '{}
'"
,
codec_descriptor
->
name
);
AVCodec
*
codec
=
avcodec_find_decoder
(
codec_params
.
codec_id
);
...
...
@@ -602,8 +602,8 @@ ffmpeg_decode(DecoderClient &client, InputStream &input)
FfmpegOpenInput
(
stream
.
io
,
input
.
GetURI
(),
nullptr
);
const
auto
*
input_format
=
format_context
->
iformat
;
F
ormatDebug
(
ffmpeg_domain
,
"detected input format '%s' (%s
)"
,
input_format
->
name
,
input_format
->
long_name
);
F
mtDebug
(
ffmpeg_domain
,
"detected input format '{}' ({}
)"
,
input_format
->
name
,
input_format
->
long_name
);
FfmpegDecode
(
client
,
&
input
,
*
format_context
);
}
...
...
@@ -668,8 +668,8 @@ ffmpeg_uri_decode(DecoderClient &client, const char *uri)
FfmpegOpenInput
(
nullptr
,
uri
,
nullptr
);
const
auto
*
input_format
=
format_context
->
iformat
;
F
ormatDebug
(
ffmpeg_domain
,
"detected input format '%s' (%s
)"
,
input_format
->
name
,
input_format
->
long_name
);
F
mtDebug
(
ffmpeg_domain
,
"detected input format '{}' ({}
)"
,
input_format
->
name
,
input_format
->
long_name
);
FfmpegDecode
(
client
,
nullptr
,
*
format_context
);
}
...
...
src/decoder/plugins/MikmodDecoderPlugin.cxx
View file @
6f539cfc
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "MikmodDecoderPlugin.hxx"
#include "../DecoderAPI.hxx"
#include "lib/fmt/PathFormatter.hxx"
#include "tag/Handler.hxx"
#include "fs/Path.hxx"
#include "util/Domain.hxx"
...
...
@@ -126,9 +127,9 @@ mikmod_decoder_init(const ConfigBlock &block)
DMODE_16BITS
);
if
(
MikMod_Init
(
params
))
{
F
orma
tError
(
mikmod_domain
,
"Could not init MikMod: %s
"
,
MikMod_strerror
(
MikMod_errno
));
F
m
tError
(
mikmod_domain
,
"Could not init MikMod: {}
"
,
MikMod_strerror
(
MikMod_errno
));
return
false
;
}
...
...
@@ -155,8 +156,7 @@ mikmod_decoder_file_decode(DecoderClient &client, Path path_fs)
handle
=
Player_Load
(
path2
,
128
,
0
);
if
(
handle
==
nullptr
)
{
FormatError
(
mikmod_domain
,
"failed to open mod: %s"
,
path_fs
.
c_str
());
FmtError
(
mikmod_domain
,
"failed to open mod: {}"
,
path_fs
);
return
;
}
...
...
@@ -189,8 +189,7 @@ mikmod_decoder_scan_file(Path path_fs, TagHandler &handler) noexcept
MODULE
*
handle
=
Player_Load
(
path2
,
128
,
0
);
if
(
handle
==
nullptr
)
{
FormatDebug
(
mikmod_domain
,
"Failed to open file: %s"
,
path_fs
.
c_str
());
FmtDebug
(
mikmod_domain
,
"Failed to open file: {}"
,
path_fs
);
return
false
;
}
...
...
src/decoder/plugins/Mpg123DecoderPlugin.cxx
View file @
6f539cfc
...
...
@@ -65,9 +65,9 @@ mpd_mpg123_open(mpg123_handle *handle, const char *path_fs,
{
int
error
=
mpg123_open
(
handle
,
path_fs
);
if
(
error
!=
MPG123_OK
)
{
F
orma
tWarning
(
mpg123_domain
,
"libmpg123 failed to open %s: %s
"
,
path_fs
,
mpg123_plain_strerror
(
error
));
F
m
tWarning
(
mpg123_domain
,
"libmpg123 failed to open {}: {}
"
,
path_fs
,
mpg123_plain_strerror
(
error
));
return
false
;
}
...
...
@@ -77,17 +77,17 @@ mpd_mpg123_open(mpg123_handle *handle, const char *path_fs,
int
channels
,
encoding
;
error
=
mpg123_getformat
(
handle
,
&
rate
,
&
channels
,
&
encoding
);
if
(
error
!=
MPG123_OK
)
{
F
orma
tWarning
(
mpg123_domain
,
"mpg123_getformat() failed: %s
"
,
mpg123_plain_strerror
(
error
));
F
m
tWarning
(
mpg123_domain
,
"mpg123_getformat() failed: {}
"
,
mpg123_plain_strerror
(
error
));
return
false
;
}
if
(
encoding
!=
MPG123_ENC_SIGNED_16
)
{
/* other formats not yet implemented */
F
orma
tWarning
(
mpg123_domain
,
"expected MPG123_ENC_SIGNED_16, got %d
"
,
encoding
);
F
m
tWarning
(
mpg123_domain
,
"expected MPG123_ENC_SIGNED_16, got {}
"
,
encoding
);
return
false
;
}
...
...
@@ -187,9 +187,9 @@ mpd_mpg123_file_decode(DecoderClient &client, Path path_fs)
int
error
;
mpg123_handle
*
const
handle
=
mpg123_new
(
nullptr
,
&
error
);
if
(
handle
==
nullptr
)
{
F
orma
tError
(
mpg123_domain
,
"mpg123_new() failed: %s
"
,
mpg123_plain_strerror
(
error
));
F
m
tError
(
mpg123_domain
,
"mpg123_new() failed: {}
"
,
mpg123_plain_strerror
(
error
));
return
;
}
...
...
@@ -238,9 +238,9 @@ mpd_mpg123_file_decode(DecoderClient &client, Path path_fs)
error
=
mpg123_read
(
handle
,
buffer
,
sizeof
(
buffer
),
&
nbytes
);
if
(
error
!=
MPG123_OK
)
{
if
(
error
!=
MPG123_DONE
)
F
orma
tWarning
(
mpg123_domain
,
"mpg123_read() failed: %s
"
,
mpg123_plain_strerror
(
error
));
F
m
tWarning
(
mpg123_domain
,
"mpg123_read() failed: {}
"
,
mpg123_plain_strerror
(
error
));
break
;
}
...
...
@@ -277,9 +277,9 @@ mpd_mpg123_scan_file(Path path_fs, TagHandler &handler) noexcept
int
error
;
mpg123_handle
*
const
handle
=
mpg123_new
(
nullptr
,
&
error
);
if
(
handle
==
nullptr
)
{
F
orma
tError
(
mpg123_domain
,
"mpg123_new() failed: %s
"
,
mpg123_plain_strerror
(
error
));
F
m
tError
(
mpg123_domain
,
"mpg123_new() failed: {}
"
,
mpg123_plain_strerror
(
error
));
return
false
;
}
...
...
src/event/ServerSocket.cxx
View file @
6f539cfc
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "ServerSocket.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "net/IPv4Address.hxx"
#include "net/IPv6Address.hxx"
#include "net/StaticSocketAddress.hxx"
...
...
@@ -150,16 +151,16 @@ ServerSocket::OneServerSocket::Accept() noexcept
UniqueSocketDescriptor
peer_fd
(
event
.
GetSocket
().
AcceptNonBlock
(
peer_address
));
if
(
!
peer_fd
.
IsDefined
())
{
const
SocketErrorMessage
msg
;
F
orma
tError
(
server_socket_domain
,
"accept() failed: %s
"
,
(
const
char
*
)
msg
);
F
m
tError
(
server_socket_domain
,
"accept() failed: {}
"
,
(
const
char
*
)
msg
);
return
;
}
if
(
!
peer_fd
.
SetKeepAlive
())
{
const
SocketErrorMessage
msg
;
F
orma
tError
(
server_socket_domain
,
"Could not set TCP keepalive option: %s
"
,
(
const
char
*
)
msg
);
F
m
tError
(
server_socket_domain
,
"Could not set TCP keepalive option: {}
"
,
(
const
char
*
)
msg
);
}
const
auto
uid
=
get_remote_uid
(
peer_fd
.
Get
());
...
...
@@ -227,12 +228,13 @@ ServerSocket::Open()
if
(
good
!=
nullptr
&&
good
->
GetSerial
()
==
i
.
GetSerial
())
{
const
auto
address_string
=
i
.
ToString
();
const
auto
good_string
=
good
->
ToString
();
FormatError
(
std
::
current_exception
(),
"bind to '%s' failed "
"(continuing anyway, because "
"binding to '%s' succeeded)"
,
address_string
.
c_str
(),
good_string
.
c_str
());
FmtError
(
server_socket_domain
,
"bind to '{}' failed "
"(continuing anyway, because "
"binding to '{}' succeeded): {}"
,
address_string
,
good_string
,
std
::
current_exception
());
}
else
if
(
bad
==
nullptr
)
{
bad
=
&
i
;
...
...
src/fs/Charset.cxx
View file @
6f539cfc
...
...
@@ -48,8 +48,8 @@ SetFSCharset(const char *charset)
fs_converter
=
IcuConverter
::
Create
(
charset
);
assert
(
fs_converter
!=
nullptr
);
F
orma
tDebug
(
path_domain
,
"SetFSCharset: fs charset is: %s"
,
fs_charset
.
c_str
()
);
F
m
tDebug
(
path_domain
,
"SetFSCharset: fs charset is {}"
,
fs_charset
);
}
#endif
...
...
src/fs/CheckFile.cxx
View file @
6f539cfc
...
...
@@ -19,6 +19,7 @@
#include "CheckFile.hxx"
#include "Log.hxx"
#include "lib/fmt/PathFormatter.hxx"
#include "config/Domain.hxx"
#include "FileInfo.hxx"
#include "Path.hxx"
...
...
@@ -31,8 +32,7 @@ CheckDirectoryReadable(Path path_fs)
try
{
const
FileInfo
fi
(
path_fs
);
if
(
!
fi
.
IsDirectory
())
{
FormatError
(
config_domain
,
"Not a directory: %s"
,
path_fs
.
ToUTF8
().
c_str
());
FmtError
(
config_domain
,
"Not a directory: {}"
,
path_fs
);
return
;
}
...
...
@@ -42,9 +42,9 @@ try {
const
FileInfo
fi2
(
x
);
}
catch
(
const
std
::
system_error
&
e
)
{
if
(
IsAccessDenied
(
e
))
F
orma
tError
(
config_domain
,
"No permission to traverse (
\"
execute
\"
) directory: %s
"
,
path_fs
.
ToUTF8
().
c_str
()
);
F
m
tError
(
config_domain
,
"No permission to traverse (
\"
execute
\"
) directory: {}
"
,
path_fs
);
}
#endif
...
...
@@ -52,9 +52,9 @@ try {
const
DirectoryReader
reader
(
path_fs
);
}
catch
(
const
std
::
system_error
&
e
)
{
if
(
IsAccessDenied
(
e
))
F
orma
tError
(
config_domain
,
"No permission to read directory: %s
"
,
path_fs
.
ToUTF8
().
c_str
()
);
F
m
tError
(
config_domain
,
"No permission to read directory: {}
"
,
path_fs
);
}
}
catch
(...)
{
LogError
(
std
::
current_exception
());
...
...
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
6f539cfc
...
...
@@ -207,7 +207,8 @@ input_cdio_open(const char *uri,
cdio_cddap_verbose_set
(
drv
,
CDDA_MESSAGE_FORGETIT
,
CDDA_MESSAGE_FORGETIT
);
if
(
speed
>
0
)
{
FormatDebug
(
cdio_domain
,
"Attempting to set CD speed to %dx"
,
speed
);
FmtDebug
(
cdio_domain
,
"Attempting to set CD speed to {}x"
,
speed
);
cdio_cddap_speed_set
(
drv
,
speed
);
}
...
...
@@ -301,8 +302,8 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
}
catch
(...)
{
char
*
s_err
=
cdio_cddap_errors
(
drv
);
if
(
s_err
)
{
F
orma
tError
(
cdio_domain
,
"paranoia_read: %s
"
,
s_err
);
F
m
tError
(
cdio_domain
,
"paranoia_read: {}
"
,
s_err
);
cdio_cddap_free_messages
(
s_err
);
}
...
...
src/input/plugins/TidalInputPlugin.cxx
View file @
6f539cfc
...
...
@@ -27,10 +27,10 @@
#include "input/ProxyInputStream.hxx"
#include "input/FailingInputStream.hxx"
#include "input/InputPlugin.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "config/Block.hxx"
#include "thread/Mutex.hxx"
#include "util/Domain.hxx"
#include "util/Exception.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
...
...
@@ -117,8 +117,8 @@ TidalInputStream::OnTidalSession() noexcept
void
TidalInputStream
::
OnTidalTrackSuccess
(
std
::
string
url
)
noexcept
{
F
ormatDebug
(
tidal_domain
,
"Tidal track '%s' resolves to %s
"
,
track_id
.
c_str
(),
url
.
c_str
()
);
F
mtDebug
(
tidal_domain
,
"Tidal track '{}' resolves to {}
"
,
track_id
,
url
);
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
...
...
@@ -154,8 +154,8 @@ TidalInputStream::OnTidalTrackError(std::exception_ptr e) noexcept
/* the session has expired - obtain a new session id
by logging in again */
F
ormatInfo
(
tidal_domain
,
"Session expired ('%s'), retrying to log in"
,
GetFullMessage
(
e
).
c_str
()
);
F
mtInfo
(
tidal_domain
,
"Session expired ('{}'), retrying to log in"
,
e
);
retry_login
=
false
;
tidal_session
->
AddLoginHandler
(
*
this
);
...
...
src/lib/ffmpeg/LogError.cxx
View file @
6f539cfc
...
...
@@ -38,5 +38,5 @@ LogFfmpegError(int errnum, const char *prefix)
{
char
msg
[
256
];
av_strerror
(
errnum
,
msg
,
sizeof
(
msg
));
F
ormatError
(
ffmpeg_domain
,
"%s: %s
"
,
prefix
,
msg
);
F
mtError
(
ffmpeg_domain
,
"{}: {}
"
,
prefix
,
msg
);
}
src/lib/pulse/LogError.cxx
View file @
6f539cfc
...
...
@@ -28,5 +28,5 @@ void
LogPulseError
(
pa_context
*
context
,
const
char
*
prefix
)
noexcept
{
const
int
e
=
pa_context_errno
(
context
);
F
ormatError
(
pulse_domain
,
"%s: %s
"
,
prefix
,
pa_strerror
(
e
));
F
mtError
(
pulse_domain
,
"{}: {}
"
,
prefix
,
pa_strerror
(
e
));
}
src/mixer/Volume.cxx
View file @
6f539cfc
...
...
@@ -106,8 +106,8 @@ read_sw_volume_state(const char *line, MultipleOutputs &outputs)
if
(
*
end
==
0
&&
sv
>=
0
&&
sv
<=
100
)
software_volume_change
(
outputs
,
sv
);
else
F
orma
tWarning
(
volume_domain
,
"Can't parse software volume: %s
"
,
line
);
F
m
tWarning
(
volume_domain
,
"Can't parse software volume: {}
"
,
line
);
return
true
;
}
...
...
src/mixer/plugins/AlsaMixerPlugin.cxx
View file @
6f539cfc
...
...
@@ -125,9 +125,9 @@ AlsaMixerMonitor::DispatchSockets() noexcept
int
err
=
snd_mixer_handle_events
(
mixer
);
if
(
err
<
0
)
{
F
orma
tError
(
alsa_mixer_domain
,
"snd_mixer_handle_events() failed: %s
"
,
snd_strerror
(
err
));
F
m
tError
(
alsa_mixer_domain
,
"snd_mixer_handle_events() failed: {}
"
,
snd_strerror
(
err
));
if
(
err
==
-
ENODEV
)
{
/* the sound device was unplugged; disable
...
...
src/output/Control.cxx
View file @
6f539cfc
...
...
@@ -20,6 +20,8 @@
#include "Control.hxx"
#include "Filtered.hxx"
#include "Client.hxx"
#include "Domain.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "mixer/MixerControl.hxx"
#include "config/Block.hxx"
#include "Log.hxx"
...
...
@@ -286,9 +288,9 @@ AudioOutputControl::Open(std::unique_lock<Mutex> &lock,
try
{
mixer_open
(
output
->
mixer
);
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to open mixer for '%s'
"
,
GetName
());
F
mtError
(
output_domain
,
"Failed to open mixer for '{}': {}
"
,
GetName
(),
std
::
current_exception
());
}
}
...
...
src/output/Filtered.cxx
View file @
6f539cfc
...
...
@@ -20,12 +20,14 @@
#include "Filtered.hxx"
#include "Interface.hxx"
#include "Domain.hxx"
#include "Log.hxx"
#include "lib/fmt/AudioFormatFormatter.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "mixer/MixerInternal.hxx"
#include "mixer/plugins/SoftwareMixerPlugin.hxx"
#include "filter/plugins/ConvertFilterPlugin.hxx"
#include "util/RuntimeError.hxx"
#include "util/StringBuffer.hxx"
#include "Log.hxx"
bool
FilteredAudioOutput
::
SupportsEnableDisable
()
const
noexcept
...
...
@@ -91,10 +93,9 @@ FilteredAudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format)
GetLogName
()));
}
FormatDebug
(
output_domain
,
"opened %s audio_format=%s"
,
GetLogName
(),
ToString
(
out_audio_format
).
c_str
());
FmtDebug
(
output_domain
,
"opened {} audio_format={}"
,
GetLogName
(),
out_audio_format
);
try
{
ConfigureConvertFilter
();
...
...
@@ -109,7 +110,7 @@ FilteredAudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format)
DSD and fall back to PCM */
LogError
(
std
::
current_exception
());
Format
Error
(
output_domain
,
"Retrying without DSD"
);
Log
Error
(
output_domain
,
"Retrying without DSD"
);
desired_audio_format
.
format
=
SampleFormat
::
FLOAT
;
OpenOutputAndConvert
(
desired_audio_format
);
...
...
@@ -127,8 +128,9 @@ FilteredAudioOutput::CloseOutput(bool drain) noexcept
try
{
Drain
();
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to drain %s"
,
GetLogName
());
FmtError
(
output_domain
,
"Failed to drain {}: {}"
,
GetLogName
(),
std
::
current_exception
());
}
}
else
Cancel
();
...
...
@@ -156,7 +158,7 @@ FilteredAudioOutput::Close(bool drain) noexcept
CloseOutput
(
drain
);
CloseSoftwareMixer
();
F
ormatDebug
(
output_domain
,
"closed %s
"
,
GetLogName
());
F
mtDebug
(
output_domain
,
"closed {}
"
,
GetLogName
());
}
std
::
chrono
::
steady_clock
::
duration
...
...
src/output/Init.cxx
View file @
6f539cfc
...
...
@@ -22,6 +22,7 @@
#include "Domain.hxx"
#include "OutputAPI.hxx"
#include "Defaults.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "pcm/AudioParser.hxx"
#include "mixer/MixerList.hxx"
#include "mixer/MixerType.hxx"
...
...
@@ -68,9 +69,9 @@ audio_output_detect()
if
(
plugin
->
test_default_device
==
nullptr
)
continue
;
F
orma
tInfo
(
output_domain
,
"Attempting to detect a %s
audio device"
,
plugin
->
name
);
F
m
tInfo
(
output_domain
,
"Attempting to detect a {}
audio device"
,
plugin
->
name
);
if
(
ao_plugin_test_default_device
(
plugin
))
return
plugin
;
}
...
...
@@ -188,9 +189,9 @@ FilteredAudioOutput::Configure(const ConfigBlock &block,
/* It's not really fatal - Part of the filter chain
has been set up already and even an empty one will
work (if only with unexpected behaviour) */
F
ormatError
(
std
::
current_exception
()
,
"Failed to initialize filter chain for '%s'
"
,
name
);
F
mtError
(
output_domain
,
"Failed to initialize filter chain for '{}': {}
"
,
name
,
std
::
current_exception
()
);
}
}
...
...
@@ -238,9 +239,9 @@ FilteredAudioOutput::Setup(EventLoop &event_loop,
*
prepared_filter
,
mixer_listener
);
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to initialize hardware mixer for '%s'
"
,
name
);
F
mtError
(
output_domain
,
"Failed to initialize hardware mixer for '{}': {}
"
,
name
,
std
::
current_exception
()
);
}
/* use the hardware mixer for replay gain? */
...
...
@@ -250,8 +251,8 @@ FilteredAudioOutput::Setup(EventLoop &event_loop,
replay_gain_filter_set_mixer
(
*
prepared_replay_gain_filter
,
mixer
,
100
);
else
F
orma
tError
(
output_domain
,
"No such mixer for output '%s
'"
,
name
);
F
m
tError
(
output_domain
,
"No such mixer for output '{}
'"
,
name
);
}
else
if
(
!
StringIsEqual
(
replay_gain_handler
,
"software"
)
&&
prepared_replay_gain_filter
!=
nullptr
)
{
throw
std
::
runtime_error
(
"Invalid
\"
replay_gain_handler
\"
value"
);
...
...
@@ -289,9 +290,9 @@ audio_output_new(EventLoop &normal_event_loop, EventLoop &rt_event_loop,
plugin
=
audio_output_detect
();
F
orma
tNotice
(
output_domain
,
"Successfully detected a %s
audio device"
,
plugin
->
name
);
F
m
tNotice
(
output_domain
,
"Successfully detected a {}
audio device"
,
plugin
->
name
);
}
/* use the real-time I/O thread only for the ALSA plugin;
...
...
src/output/Thread.cxx
View file @
6f539cfc
...
...
@@ -22,6 +22,8 @@
#include "Filtered.hxx"
#include "Client.hxx"
#include "Domain.hxx"
#include "lib/fmt/AudioFormatFormatter.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "thread/Util.hxx"
#include "thread/Slack.hxx"
#include "thread/Name.hxx"
...
...
@@ -166,10 +168,8 @@ AudioOutputControl::InternalOpen(const AudioFormat in_audio_format,
}
if
(
f
!=
in_audio_format
||
f
!=
output
->
out_audio_format
)
FormatDebug
(
output_domain
,
"converting in=%s -> f=%s -> out=%s"
,
ToString
(
in_audio_format
).
c_str
(),
ToString
(
f
).
c_str
(),
ToString
(
output
->
out_audio_format
).
c_str
());
FmtDebug
(
output_domain
,
"converting in={} -> f={} -> out={}"
,
in_audio_format
,
f
,
output
->
out_audio_format
);
}
inline
void
...
...
@@ -231,8 +231,9 @@ AudioOutputControl::FillSourceOrClose() noexcept
try
{
return
source
.
Fill
(
mutex
);
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to filter for %s"
,
GetLogName
());
FmtError
(
output_domain
,
"Failed to filter for {}: {}"
,
GetLogName
(),
std
::
current_exception
());
InternalCloseError
(
std
::
current_exception
());
return
false
;
}
...
...
@@ -250,9 +251,9 @@ AudioOutputControl::PlayChunk(std::unique_lock<Mutex> &lock) noexcept
caught_interrupted
=
true
;
return
false
;
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to send tag to %s
"
,
GetLogName
());
F
mtError
(
output_domain
,
"Failed to send tag to {}: {}
"
,
GetLogName
(),
std
::
current_exception
());
}
}
...
...
@@ -277,8 +278,9 @@ AudioOutputControl::PlayChunk(std::unique_lock<Mutex> &lock) noexcept
caught_interrupted
=
true
;
return
false
;
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to play on %s"
,
GetLogName
());
FmtError
(
output_domain
,
"Failed to play on {}"
,
GetLogName
(),
std
::
current_exception
());
InternalCloseError
(
std
::
current_exception
());
return
false
;
}
...
...
@@ -356,9 +358,9 @@ AudioOutputControl::InternalPause(std::unique_lock<Mutex> &lock) noexcept
success
=
output
->
IteratePause
();
}
catch
(
AudioOutputInterrupted
)
{
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to pause %s
"
,
GetLogName
());
F
mtError
(
output_domain
,
"Failed to pause {}: {}
"
,
GetLogName
(),
std
::
current_exception
());
}
if
(
!
success
)
{
...
...
@@ -416,8 +418,9 @@ AudioOutputControl::InternalDrain() noexcept
output
->
Drain
();
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"Failed to flush filter on %s"
,
GetLogName
());
FmtError
(
output_domain
,
"Failed to flush filter on {}: {}"
,
GetLogName
(),
std
::
current_exception
());
InternalCloseError
(
std
::
current_exception
());
return
;
}
...
...
src/output/plugins/AlsaOutputPlugin.cxx
View file @
6f539cfc
...
...
@@ -498,9 +498,9 @@ alsa_test_default_device()
int
ret
=
snd_pcm_open
(
&
handle
,
default_device
,
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
);
if
(
ret
)
{
F
orma
tError
(
alsa_output_domain
,
"Error opening default ALSA device: %s
"
,
snd_strerror
(
-
ret
));
F
m
tError
(
alsa_output_domain
,
"Error opening default ALSA device: {}
"
,
snd_strerror
(
-
ret
));
return
false
;
}
else
snd_pcm_close
(
handle
);
...
...
@@ -548,13 +548,13 @@ AlsaOutput::Setup(AudioFormat &audio_format,
buffer_time
,
period_time
,
audio_format
,
params
);
F
ormatDebug
(
alsa_output_domain
,
"format=%s (%s
)"
,
snd_pcm_format_name
(
hw_result
.
format
),
snd_pcm_format_description
(
hw_result
.
format
));
F
mtDebug
(
alsa_output_domain
,
"format={} ({}
)"
,
snd_pcm_format_name
(
hw_result
.
format
),
snd_pcm_format_description
(
hw_result
.
format
));
F
ormatDebug
(
alsa_output_domain
,
"buffer_size=%u period_size=%u
"
,
(
unsigned
)
hw_result
.
buffer_size
,
(
unsigned
)
hw_result
.
period_size
);
F
mtDebug
(
alsa_output_domain
,
"buffer_size={} period_size={}
"
,
hw_result
.
buffer_size
,
hw_result
.
period_size
);
AlsaSetupSw
(
pcm
,
hw_result
.
buffer_size
-
hw_result
.
period_size
,
hw_result
.
period_size
);
...
...
@@ -708,9 +708,9 @@ AlsaOutput::Open(AudioFormat &audio_format)
throw
FormatRuntimeError
(
"Failed to open ALSA device
\"
%s
\"
: %s"
,
GetDevice
(),
snd_strerror
(
err
));
F
ormatDebug
(
alsa_output_domain
,
"opened %s type=%s
"
,
snd_pcm_name
(
pcm
),
snd_pcm_type_name
(
snd_pcm_type
(
pcm
)));
F
mtDebug
(
alsa_output_domain
,
"opened {} type={}
"
,
snd_pcm_name
(
pcm
),
snd_pcm_type_name
(
snd_pcm_type
(
pcm
)));
PcmExport
::
Params
params
;
params
.
alsa_channel_order
=
true
;
...
...
@@ -734,7 +734,7 @@ AlsaOutput::Open(AudioFormat &audio_format)
#ifdef ENABLE_DSD
if
(
params
.
dsd_mode
==
PcmExport
::
DsdMode
::
DOP
)
Format
Debug
(
alsa_output_domain
,
"DoP (DSD over PCM) enabled"
);
Log
Debug
(
alsa_output_domain
,
"DoP (DSD over PCM) enabled"
);
#endif
pcm_export
->
Open
(
audio_format
.
format
,
...
...
@@ -775,13 +775,13 @@ inline int
AlsaOutput
::
Recover
(
int
err
)
noexcept
{
if
(
err
==
-
EPIPE
)
{
F
orma
tDebug
(
alsa_output_domain
,
"Underrun on ALSA device
\"
%s
\"
"
,
GetDevice
());
F
m
tDebug
(
alsa_output_domain
,
"Underrun on ALSA device
\"
{}
\"
"
,
GetDevice
());
}
else
if
(
err
==
-
ESTRPIPE
)
{
F
orma
tDebug
(
alsa_output_domain
,
"ALSA device
\"
%s
\"
was suspended"
,
GetDevice
());
F
m
tDebug
(
alsa_output_domain
,
"ALSA device
\"
{}
\"
was suspended"
,
GetDevice
());
}
switch
(
snd_pcm_state
(
pcm
))
{
...
...
@@ -1158,7 +1158,7 @@ try {
}
if
(
throttle_silence_log
.
CheckUpdate
(
std
::
chrono
::
seconds
(
5
)))
Format
Warning
(
alsa_output_domain
,
"Decoder is too slow; playing silence to avoid xrun"
);
Log
Warning
(
alsa_output_domain
,
"Decoder is too slow; playing silence to avoid xrun"
);
/* insert some silence if the buffer has not enough
data yet, to avoid ALSA xrun */
...
...
src/output/plugins/SndioOutputPlugin.cxx
View file @
6f539cfc
...
...
@@ -60,8 +60,8 @@ sndio_test_default_device()
{
auto
*
hdl
=
sio_open
(
SIO_DEVANY
,
SIO_PLAY
,
0
);
if
(
!
hdl
)
{
Format
Error
(
sndio_output_domain
,
"Error opening default sndio device"
);
Log
Error
(
sndio_output_domain
,
"Error opening default sndio device"
);
return
false
;
}
...
...
src/output/plugins/sles/SlesOutputPlugin.cxx
View file @
6f539cfc
...
...
@@ -391,12 +391,12 @@ SlesOutput::Cancel() noexcept
SLresult
result
=
play
.
SetPlayState
(
SL_PLAYSTATE_PAUSED
);
if
(
result
!=
SL_RESULT_SUCCESS
)
Format
Error
(
sles_domain
,
"Play.SetPlayState(PAUSED) failed"
);
Log
Error
(
sles_domain
,
"Play.SetPlayState(PAUSED) failed"
);
result
=
queue
.
Clear
();
if
(
result
!=
SL_RESULT_SUCCESS
)
Format
Warning
(
sles_domain
,
"AndroidSimpleBufferQueue.Clear() failed"
);
Log
Warning
(
sles_domain
,
"AndroidSimpleBufferQueue.Clear() failed"
);
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
n_queued
=
0
;
...
...
src/output/plugins/wasapi/WasapiOutputPlugin.cxx
View file @
6f539cfc
...
...
@@ -422,7 +422,7 @@ inline void
WasapiOutputThread
::
Work
()
noexcept
try
{
SetThreadName
(
"Wasapi Output Worker"
);
Format
Debug
(
wasapi_output_domain
,
"Working thread started"
);
Log
Debug
(
wasapi_output_domain
,
"Working thread started"
);
COM
com
;
AtScopeExit
(
this
)
{
...
...
@@ -448,8 +448,8 @@ try {
Status
current_state
=
status
.
load
();
switch
(
current_state
)
{
case
Status
:
:
FINISH
:
Format
Debug
(
wasapi_output_domain
,
"Working thread stopped"
);
Log
Debug
(
wasapi_output_domain
,
"Working thread stopped"
);
return
;
case
Status
:
:
PAUSE
:
...
...
@@ -589,8 +589,8 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
if
(
device_format
.
Format
.
wBitsPerSample
==
24
)
{
params
.
pack24
=
true
;
}
F
ormatDebug
(
wasapi_output_domain
,
"Packing data: shift8=%d pack24=%d
"
,
int
(
params
.
shift8
),
int
(
params
.
pack24
)
);
F
mtDebug
(
wasapi_output_domain
,
"Packing data: shift8={} pack24={}
"
,
params
.
shift8
,
params
.
pack24
);
pcm_export
.
emplace
();
pcm_export
->
Open
(
audio_format
.
format
,
audio_format
.
channels
,
params
);
}
...
...
@@ -608,11 +608,11 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
FAILED
(
result
))
{
throw
MakeHResultError
(
result
,
"Unable to get device period"
);
}
F
orma
tDebug
(
wasapi_output_domain
,
"Default device period: %lu
ns, Minimum device period: "
"%lu
ns"
,
(
unsigned
long
)
ns
(
hundred_ns
(
default_device_period
)).
count
(),
(
unsigned
long
)
ns
(
hundred_ns
(
min_device_period
)).
count
());
F
m
tDebug
(
wasapi_output_domain
,
"Default device period: {}
ns, Minimum device period: "
"{}
ns"
,
ns
(
hundred_ns
(
default_device_period
)).
count
(),
ns
(
hundred_ns
(
min_device_period
)).
count
());
REFERENCE_TIME
buffer_duration
;
if
(
Exclusive
())
{
...
...
@@ -621,8 +621,8 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
const
REFERENCE_TIME
align
=
hundred_ns
(
ms
(
50
)).
count
();
buffer_duration
=
(
align
/
default_device_period
)
*
default_device_period
;
}
F
ormatDebug
(
wasapi_output_domain
,
"Buffer duration: %lu
ns"
,
(
unsigned
long
)
ns
(
hundred_ns
(
buffer_duration
)).
count
());
F
mtDebug
(
wasapi_output_domain
,
"Buffer duration: {}
ns"
,
ns
(
hundred_ns
(
buffer_duration
)).
count
());
if
(
Exclusive
())
{
if
(
HRESULT
result
=
client
->
Initialize
(
...
...
@@ -639,10 +639,9 @@ WasapiOutput::DoOpen(AudioFormat &audio_format)
std
::
ceil
(
double
(
buffer_size_in_frames
*
hundred_ns
(
s
(
1
)).
count
())
/
SampleRate
());
FormatDebug
(
wasapi_output_domain
,
"Aligned buffer duration: %lu ns"
,
(
unsigned
long
)
ns
(
hundred_ns
(
buffer_duration
)).
count
());
FmtDebug
(
wasapi_output_domain
,
"Aligned buffer duration: {} ns"
,
ns
(
hundred_ns
(
buffer_duration
)).
count
());
client
.
reset
();
client
=
Activate
<
IAudioClient
>
(
*
device
);
result
=
client
->
Initialize
(
...
...
@@ -687,8 +686,7 @@ WasapiOutput::Close() noexcept
try
{
thread
->
CheckException
();
}
catch
(...)
{
FormatError
(
std
::
current_exception
(),
"exception while stopping"
);
LogError
(
wasapi_output_domain
,
"exception while stopping"
);
}
thread
->
Finish
();
com_worker
->
Async
([
&
]()
{
...
...
@@ -1029,8 +1027,8 @@ WasapiOutput::EnumerateDevices(IMMDeviceEnumerator &enumerator)
if
(
name
==
nullptr
)
continue
;
F
orma
tNotice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
i
,
name
.
c_str
()
);
F
m
tNotice
(
wasapi_output_domain
,
"Device
\"
{}
\"
\"
{}
\"
"
,
i
,
name
);
}
}
...
...
src/player/Thread.cxx
View file @
6f539cfc
...
...
@@ -558,10 +558,10 @@ Player::CheckDecoderStartup(std::unique_lock<Mutex> &lock) noexcept
}
if
(
!
paused
&&
!
OpenOutput
())
{
F
orma
tError
(
player_domain
,
"problems opening audio device "
"while playing
\"
%s
\"
"
,
dc
.
song
->
GetURI
());
F
m
tError
(
player_domain
,
"problems opening audio device "
"while playing
\"
{}
\"
"
,
dc
.
song
->
GetURI
());
return
true
;
}
...
...
@@ -964,7 +964,7 @@ Player::SongBorder() noexcept
{
const
ScopeUnlock
unlock
(
pc
.
mutex
);
F
ormatNotice
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
F
mtNotice
(
player_domain
,
"played
\"
{}
\"
"
,
song
->
GetURI
());
ReplacePipe
(
dc
.
pipe
);
...
...
@@ -1135,7 +1135,7 @@ Player::Run() noexcept
cross_fade_tag
.
reset
();
if
(
song
!=
nullptr
)
{
F
ormatNotice
(
player_domain
,
"played
\"
%s
\"
"
,
song
->
GetURI
());
F
mtNotice
(
player_domain
,
"played
\"
{}
\"
"
,
song
->
GetURI
());
song
.
reset
();
}
...
...
src/storage/StorageState.cxx
View file @
6f539cfc
...
...
@@ -23,6 +23,7 @@
*/
#include "StorageState.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "fs/io/TextFile.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "storage/Registry.hxx"
...
...
@@ -90,7 +91,9 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
else
if
((
value
=
StringAfterPrefix
(
line
,
MOUNT_STATE_STORAGE_URI
)))
uri
=
value
;
else
FormatError
(
storage_domain
,
"Unrecognized line in mountpoint state: %s"
,
line
);
FmtError
(
storage_domain
,
"Unrecognized line in mountpoint state: {}"
,
line
);
}
if
(
instance
.
storage
==
nullptr
)
...
...
@@ -104,7 +107,7 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
return
true
;
}
F
ormatDebug
(
storage_domain
,
"Restoring mount %s => %s"
,
uri
.
c_str
(),
url
.
c_str
()
);
F
mtDebug
(
storage_domain
,
"Restoring mount {} => {}"
,
uri
,
url
);
auto
&
composite_storage
=
*
(
CompositeStorage
*
)
instance
.
storage
;
if
(
composite_storage
.
IsMountPoint
(
uri
.
c_str
()))
{
...
...
@@ -120,7 +123,7 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
auto
&
event_loop
=
instance
.
io_thread
.
GetEventLoop
();
auto
storage
=
CreateStorageURI
(
event_loop
,
url
.
c_str
());
if
(
storage
==
nullptr
)
{
F
ormatError
(
storage_domain
,
"Unrecognized storage URI: %s"
,
url
.
c_str
()
);
F
mtError
(
storage_domain
,
"Unrecognized storage URI: {}"
,
url
);
return
true
;
}
...
...
@@ -128,9 +131,9 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
try
{
db
->
Mount
(
uri
.
c_str
(),
url
.
c_str
());
}
catch
(...)
{
F
ormatError
(
std
::
current_exception
()
,
"Failed to restore mount to %s
"
,
url
.
c_str
());
F
mtError
(
storage_domain
,
"Failed to restore mount to {}: {}
"
,
url
,
std
::
current_exception
());
return
true
;
}
}
...
...
src/system/FatalError.cxx
View file @
6f539cfc
...
...
@@ -83,7 +83,7 @@ FatalSystemError(const char *msg)
FatalSystemError
(
msg
,
GetLastError
());
#else
auto
system_error
=
std
::
strerror
(
errno
);
F
ormatError
(
fatal_error_domain
,
"%s: %s
"
,
msg
,
system_error
);
F
mtError
(
fatal_error_domain
,
"{}: {}
"
,
msg
,
system_error
);
Abort
();
#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