mirror of
https://github.com/relan/exfat.git
synced 2026-01-12 00:18:54 +08:00
Duplicate debug messages into syslog.
May be helpful when running detached from tty.
This commit is contained in:
@@ -115,12 +115,22 @@ void exfat_warn(const char* format, ...)
|
||||
*/
|
||||
void exfat_debug(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_list ap, aq;
|
||||
|
||||
va_start(ap, format);
|
||||
va_copy(aq, ap);
|
||||
|
||||
fflush(stdout);
|
||||
fputs("DEBUG: ", stderr);
|
||||
va_start(ap, format);
|
||||
vfprintf(stderr, format, ap);
|
||||
va_end(ap);
|
||||
fputs(".\n", stderr);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
__android_log_vprint(ANDROID_LOG_DEBUG, PACKAGE, format, aq);
|
||||
#else
|
||||
if (!isatty(STDERR_FILENO))
|
||||
vsyslog(LOG_DEBUG, format, aq);
|
||||
#endif
|
||||
va_end(aq);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user