Instead of having an exception propagate into the program (which at worst causes a crash) when an error happens while formatting a log message, just print a message to the log. This message clearly indicates what log message was formatted wrongly, and what error happened during formatting it.
Addresses #9423.
Before
02017-03-09 10:58:20
1
2************************
3EXCEPTION: St13runtime_error
4tinyformat: Too many conversion specifiers in format string
5bitcoin in AppInit()
6
7
8
9************************
10EXCEPTION: St13runtime_error
11tinyformat: Too many conversion specifiers in format string
12bitcoin in AppInit()
13
142017-03-09 10:58:20 Shutdown: In progress...
152017-03-09 10:58:20 scheduler thread interrupt
162017-03-09 10:58:20 Shutdown: done
(and process exits)
After
02017-03-09 10:51:50 Error "tinyformat: Too many conversion specifiers in format string" while formatting log message: Erasing %s %s
(and process continues)