Google Cloud C++ Client  0.4.0
C++ Client Library for Google Cloud Platform
Public Member Functions | List of all members
google::cloud::v0::Logger< compile_time_enabled > Class Template Reference

Define the class to capture a log message. More...

#include <google/cloud/log.h>

Public Member Functions

 Logger (Severity severity, char const *function, char const *filename, int lineno, LogSink &sink)
 
bool enabled () const
 
void LogTo (LogSink &sink)
 Send the log record captured by this object to sink. More...
 
std::ostream & Stream ()
 Return the iostream that captures the log message. More...
 

Detailed Description

template<bool compile_time_enabled>
class google::cloud::v0::Logger< compile_time_enabled >

Define the class to capture a log message.

Template Parameters
compile_time_enabledthis represents whether the severity has been disabled at compile-time. The class is specialized for false to minimize the run-time impact of (and, in practice, completely elide) disabled logs.

Definition at line 344 of file log.h.

Constructor & Destructor Documentation

◆ Logger()

template<bool compile_time_enabled>
google::cloud::v0::Logger< compile_time_enabled >::Logger ( Severity  severity,
char const *  function,
char const *  filename,
int  lineno,
LogSink sink 
)
inline

Definition at line 346 of file log.h.

Member Function Documentation

◆ enabled()

template<bool compile_time_enabled>
bool google::cloud::v0::Logger< compile_time_enabled >::enabled ( ) const
inline

Definition at line 355 of file log.h.

◆ LogTo()

template<bool compile_time_enabled>
void google::cloud::v0::Logger< compile_time_enabled >::LogTo ( LogSink sink)
inline

Send the log record captured by this object to sink.

Definition at line 358 of file log.h.

◆ Stream()

template<bool compile_time_enabled>
std::ostream& google::cloud::v0::Logger< compile_time_enabled >::Stream ( )
inline

Return the iostream that captures the log message.

Definition at line 374 of file log.h.