Google Cloud C++ Client  1.42.0
C++ Client Library for Google Cloud Platform
Public Member Functions | List of all members
google::cloud::Logger< CompileTimeEnabled > 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)
 
 ~Logger ()
 
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 CompileTimeEnabled>
class google::cloud::Logger< CompileTimeEnabled >

Define the class to capture a log message.

Template Parameters
CompileTimeEnabledthis 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 383 of file log.h.

Constructor & Destructor Documentation

◆ Logger()

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

Definition at line 385 of file log.h.

◆ ~Logger()

template<bool CompileTimeEnabled>
google::cloud::Logger< CompileTimeEnabled >::~Logger ( )
inline

Definition at line 393 of file log.h.

Member Function Documentation

◆ enabled()

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

Definition at line 397 of file log.h.

◆ LogTo()

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

Send the log record captured by this object to sink.

Definition at line 400 of file log.h.

◆ Stream()

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

Return the iostream that captures the log message.

Definition at line 417 of file log.h.