Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
base::LogMessage Class Reference

#include <logging.h>

Public Member Functions

 LogMessage (const char *file, int line, const char *condition, bool killProcess)
 
 ~LogMessage ()
 
std::ostream & stream ()
 

Detailed Description

Definition at line 19 of file logging.h.

Constructor & Destructor Documentation

◆ LogMessage()

base::LogMessage::LogMessage ( const char *  file,
int  line,
const char *  condition,
bool  killProcess 
)

Definition at line 33 of file logging.cc.

37 : file_(file), line_(line), killProcess_(killProcess) {
38 stream_ << "[ERROR:" << StripPath(file_) << "(" << line_ << ")] ";
39
40 if (condition) {
41 stream_ << "Check failed: " << condition << ". ";
42 }
43}

◆ ~LogMessage()

base::LogMessage::~LogMessage ( )

Definition at line 45 of file logging.cc.

45 {
46 stream_ << std::endl;
47
48#if defined(OS_ANDROID)
49 android_LogPriority priority = ANDROID_LOG_ERROR __android_log_write(
50 priority, "flutter", stream_.str().c_str());
51#elif defined(OS_IOS)
52 syslog(LOG_ALERT, "%s", stream_.str().c_str());
53#else
54 std::cerr << stream_.str();
55 std::cerr.flush();
56#endif
57 if (killProcess_)
59}
void KillProcess()
Definition: logging.cc:61

Member Function Documentation

◆ stream()

std::ostream & base::LogMessage::stream ( )
inline

Definition at line 27 of file logging.h.

27{ return stream_; }

The documentation for this class was generated from the following files: