Fix a crashing issue of Android logging
Avoid using std::cerr. This patch resolves GitHub issue #38025. PiperOrigin-RevId: 346452855 Change-Id: Ife2504476b265909814c09c900cbb5090a55fcc5
This commit is contained in:
parent
a960cb2c42
commit
2d753e6a21
@ -485,7 +485,8 @@ void TFDefaultLogSink::Send(const TFLogEntry& entry) {
|
||||
__android_log_write(android_log_level, "native", ss.str().c_str());
|
||||
|
||||
// Also log to stderr (for standalone Android apps).
|
||||
std::cerr << "native : " << ss.str() << std::endl;
|
||||
// Don't use 'std::cerr' since it crashes on Android.
|
||||
fprintf(stderr, "native : %s\n", ss.str().c_str());
|
||||
|
||||
// Android logging at level FATAL does not terminate execution, so abort()
|
||||
// is still required to stop the program.
|
||||
|
Loading…
x
Reference in New Issue
Block a user