Google Cloud C++ Client 2.10.1
C++ Client Library for Google Cloud Platform
Loading...
Searching...
No Matches
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.

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

◆ ~Logger()

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

Member Function Documentation

◆ enabled()

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

◆ LogTo()

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

Send the log record captured by this object to sink.

◆ Stream()

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

Return the iostream that captures the log message.