This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Corrade::Utility::AndroidLogStreamBuffer class

Stream buffer that sends the data to Android log.

Usable in conjunction with std::ostream to redirect the output to Android log buffer, which can later be accessed through the logcat utility. The data are sent on each flush() call and then the internal buffer is cleared. Example usage:

AndroidLogStreamBuffer buffer(AndroidLogStreamBuffer::LogPriority::Info, "native-app");

std::ostream out(&buffer);

out << "Hello World!" << std::endl;

The output stream can be also used with Debug classes.

Public types

enum class LogPriority: std::int32_t { Verbose = ANDROID_LOG_VERBOSE, Debug = ANDROID_LOG_DEBUG, Info = ANDROID_LOG_INFO, Warning = ANDROID_LOG_WARN, Error = ANDROID_LOG_ERROR, Fatal = ANDROID_LOG_FATAL }
Log level.

Constructors, destructors, conversion operators

AndroidLogStreamBuffer(LogPriority priority, std::string tag) explicit
Constructor.

Protected functions

auto sync() override -> int
Send current data to the log buffer.

Enum documentation

enum class Corrade::Utility::AndroidLogStreamBuffer::LogPriority: std::int32_t

Log level.

Enumerators
Verbose

Verbose debug message

Debug

Debug message

Info

Information

Warning

Warning

Error

Error

Fatal

Fatal error

Function documentation

Corrade::Utility::AndroidLogStreamBuffer::AndroidLogStreamBuffer(LogPriority priority, std::string tag) explicit

Constructor.

Parameters
priority Log priority
tag Message tag

int Corrade::Utility::AndroidLogStreamBuffer::sync() override protected

Send current data to the log buffer.

After sending the message the internal data buffer is cleared to avoid sending the same data repeatedly.