proxygen
folly::GoogleLogger< Style > Struct Template Reference

#include <AutoTimer.h>

Public Member Functions

void operator() (StringPiece msg, const std::chrono::duration< double > &sec) const
 

Detailed Description

template<GoogleLoggerStyle Style>
struct folly::GoogleLogger< Style >

Definition at line 33 of file AutoTimer.h.

Member Function Documentation

template<GoogleLoggerStyle Style>
void folly::GoogleLogger< Style >::operator() ( StringPiece  msg,
const std::chrono::duration< double > &  sec 
) const
inline

Definition at line 136 of file AutoTimer.h.

References folly::Range< Iter >::empty(), folly::INFO, folly::PRETTY, folly::PRETTY_TIME, and folly::prettyPrint().

137  {
138  if (msg.empty()) {
139  return;
140  }
141  if (Style == GoogleLoggerStyle::PRETTY) {
142  LOG(INFO) << msg << " in "
143  << prettyPrint(sec.count(), PrettyType::PRETTY_TIME);
144  } else {
145  LOG(INFO) << msg << " in " << sec.count() << " seconds";
146  }
147  }
std::string prettyPrint(double val, PrettyType type, bool addSpace)
Definition: String.cpp:386

The documentation for this struct was generated from the following file: