MCPcopy Create free account
hub / github.com/android/ndk-samples / LogdLogger

Class LogdLogger

base/src/main/cpp/include/base/logging.h:127–136  ·  view source on GitHub ↗

The LogdLogger sends chunks of up to ~4000 bytes at a time to logd. It does not prevent other threads from writing to logd between sending each chunk, so other threads may interleave their messages. If preventing interleaving is required, then a custom logger that takes a lock before calling this logger should be provided.

Source from the content-addressed store, hash-verified

125// required, then a custom logger that takes a lock before calling this logger
126// should be provided.
127class LogdLogger {
128 public:
129 explicit LogdLogger(LogId default_log_id = ndksamples::base::MAIN);
130
131 void operator()(LogId, LogSeverity, const char* tag, const char* file,
132 unsigned int line, const char* message);
133
134 private:
135 LogId default_log_id_;
136};
137
138// Configure logging based on ANDROID_LOG_TAGS environment variable.
139// We need to parse a string that looks like

Callers 1

logging.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected