exFAT file system implementation library.
Free exFAT implementation.
- Copyright (C) 2010-2018 Andrew Nayenko
+ Copyright (C) 2010-2023 Andrew Nayenko
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
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);
}