proxygen
folly::LogCategory Class Reference

#include <LogCategory.h>

Public Member Functions

 LogCategory (LoggerDB *db)
 
 LogCategory (folly::StringPiece name, LogCategory *parent)
 
const std::stringgetName () const
 
LogLevel getLevel () const
 
std::pair< LogLevel, bool > getLevelInfo () const
 
LogLevel getEffectiveLevel () const
 
LogLevel getEffectiveLevelRelaxed () const
 
bool logCheck (LogLevel level) const
 
void setLevel (LogLevel level, bool inherit=true)
 
LoggerDBgetDB () const
 
void addHandler (std::shared_ptr< LogHandler > handler)
 
void clearHandlers ()
 
std::vector< std::shared_ptr< LogHandler > > getHandlers () const
 
void replaceHandlers (std::vector< std::shared_ptr< LogHandler >> handlers)
 
void updateHandlers (const std::unordered_map< std::shared_ptr< LogHandler >, std::shared_ptr< LogHandler >> &handlerMap)
 
void admitMessage (const LogMessage &message) const
 
void setLevelLocked (LogLevel level, bool inherit)
 
void registerXlogLevel (std::atomic< LogLevel > *levelPtr)
 

Private Types

enum  : uint32_t { FLAG_INHERIT = 0x80000000 }
 

Private Member Functions

 LogCategory (LogCategory const &)=delete
 
LogCategoryoperator= (LogCategory const &)=delete
 
 LogCategory (LogCategory &&)=delete
 
LogCategoryoperator= (LogCategory &&)=delete
 
void processMessage (const LogMessage &message) const
 
void updateEffectiveLevel (LogLevel newEffectiveLevel)
 
void parentLevelUpdated (LogLevel parentEffectiveLevel)
 

Private Attributes

std::atomic< LogLeveleffectiveLevel_ {LogLevel::MAX_LEVEL}
 
std::atomic< uint32_tlevel_ {0}
 
LogCategory *const parent_ {nullptr}
 
const std::string name_
 
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
 
LoggerDB *const db_ {nullptr}
 
LogCategoryfirstChild_ {nullptr}
 
LogCategorynextSibling_ {nullptr}
 
std::vector< std::atomic< LogLevel > * > xlogLevels_
 

Detailed Description

LogCategory stores all of the logging configuration for a specific log category.

This class is separate from Logger to allow multiple Logger objects to all refer to the same log category. Logger can be thought of as a small wrapper class that behaves like a pointer to a LogCategory object.

Definition at line 41 of file LogCategory.h.

Member Enumeration Documentation

anonymous enum : uint32_t
private
Enumerator
FLAG_INHERIT 

Definition at line 222 of file LogCategory.h.

Constructor & Destructor Documentation

folly::LogCategory::LogCategory ( LoggerDB db)
explicit

Create the root LogCategory.

This should generally only be invoked by LoggerDB.

Definition at line 32 of file LogCategory.cpp.

References db_, folly::ERR, level_, name_, parent_, and uint32_t.

34  level_{static_cast<uint32_t>(LogLevel::ERR)},
35  parent_{nullptr},
36  name_{},
37  db_{db} {}
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LoggerDB *const db_
Definition: LogCategory.h:280
const std::string name_
Definition: LogCategory.h:267
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
LogCategory *const parent_
Definition: LogCategory.h:262
folly::LogCategory::LogCategory ( folly::StringPiece  name,
LogCategory parent 
)

Create a new LogCategory.

This should only be invoked by LoggerDB, while holding the main LoggerDB lock.

The name argument should already be in canonical form.

This constructor automatically adds this new LogCategory to the parent category's firstChild_ linked-list.

Definition at line 39 of file LogCategory.cpp.

References folly::LogName::canonicalize(), db_, firstChild_, FLAG_INHERIT, getEffectiveLevel(), level_, folly::MAX_LEVEL, name, name_, nextSibling_, parent, parent_, and uint32_t.

40  : effectiveLevel_{parent->getEffectiveLevel()},
42  parent_{parent},
44  db_{parent->getDB()},
46  parent_->firstChild_ = this;
47 }
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LoggerDB *const db_
Definition: LogCategory.h:280
LogCategory * firstChild_
Definition: LogCategory.h:288
static std::string canonicalize(folly::StringPiece name)
Definition: LogName.cpp:26
const std::string name_
Definition: LogCategory.h:267
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
LogCategory *const parent_
Definition: LogCategory.h:262
LogCategory * nextSibling_
Definition: LogCategory.h:289
folly::Function< void()> parent
Definition: AtFork.cpp:34
folly::LogCategory::LogCategory ( LogCategory const &  )
privatedelete
folly::LogCategory::LogCategory ( LogCategory &&  )
privatedelete

Member Function Documentation

void folly::LogCategory::addHandler ( std::shared_ptr< LogHandler handler)

Attach a LogHandler to this category.

Definition at line 127 of file LogCategory.cpp.

References handlers_, and folly::gen::move.

Referenced by getDB(), and TEST_F().

127  {
128  auto handlers = handlers_.wlock();
129  handlers->emplace_back(std::move(handler));
130 }
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void handler(int, siginfo_t *, void *)
void folly::LogCategory::admitMessage ( const LogMessage message) const

Admit a message into the LogCategory hierarchy to be logged.

The caller is responsible for having already performed log level admittance checks.

This method generally should be invoked only through the logging macros, rather than calling this directly.

Definition at line 49 of file LogCategory.cpp.

References db_, folly::LoggerDB::flushAllHandlers(), folly::LogMessage::getFileName(), folly::LogMessage::getLevel(), folly::LogMessage::getLineNumber(), folly::LogMessage::getMessage(), folly::isLogLevelFatal(), processMessage(), and folly::writeFull().

Referenced by getDB(), and folly::LogStreamProcessor::logNow().

49  {
51 
52  // If this is a fatal message, flush the handlers to make sure the log
53  // message was written out, then crash.
54  if (isLogLevelFatal(message.getLevel())) {
55  auto numHandlers = db_->flushAllHandlers();
56  if (numHandlers == 0) {
57  // No log handlers were configured.
58  // Print the message to stderr, to make sure we always print the reason
59  // we are crashing somewhere.
60  auto msg = folly::to<std::string>(
61  "FATAL:",
62  message.getFileName(),
63  ":",
64  message.getLineNumber(),
65  ": ",
66  message.getMessage(),
67  "\n");
68  folly::writeFull(STDERR_FILENO, msg.data(), msg.size());
69  }
70  std::abort();
71  }
72 }
Definition: test.c:42
void processMessage(const LogMessage &message) const
Definition: LogCategory.cpp:74
LoggerDB *const db_
Definition: LogCategory.h:280
ssize_t writeFull(int fd, const void *buf, size_t count)
Definition: FileUtil.cpp:134
size_t flushAllHandlers()
Definition: LoggerDB.cpp:551
constexpr bool isLogLevelFatal(LogLevel level)
Definition: LogLevel.h:145
void folly::LogCategory::clearHandlers ( )

Remove all LogHandlers from this category.

Definition at line 132 of file LogCategory.cpp.

References handlers_.

Referenced by getDB().

132  {
133  std::vector<std::shared_ptr<LogHandler>> emptyHandlersList;
134  // Swap out the handlers list with the handlers_ lock held.
135  {
136  auto handlers = handlers_.wlock();
137  handlers->swap(emptyHandlersList);
138  }
139  // Destroy emptyHandlersList now that the handlers_ lock is released.
140  // This way we don't hold the handlers_ lock while invoking any of the
141  // LogHandler destructors.
142 }
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
LoggerDB* folly::LogCategory::getDB ( ) const
inline

Get the LoggerDB that this LogCategory belongs to.

This is almost always the main LoggerDB singleton returned by LoggerDB::get(). The logging unit tests are the main location that creates alternative LoggerDB objects.

Definition at line 148 of file LogCategory.h.

References addHandler(), admitMessage(), clearHandlers(), db_, getHandlers(), handler(), registerXlogLevel(), replaceHandlers(), setLevelLocked(), and updateHandlers().

148  {
149  return db_;
150  }
LoggerDB *const db_
Definition: LogCategory.h:280
LogLevel folly::LogCategory::getEffectiveLevel ( ) const
inline

Get the effective level for this log category.

This is the minimum log level of this category and all of its parents. Log messages below this level will be ignored, while messages at or above this level need to be processed by this category or one of its parents.

Definition at line 95 of file LogCategory.h.

References effectiveLevel_.

Referenced by LogCategory(), setLevelLocked(), and folly::LoggerDB::xlogInit().

95  {
96  return effectiveLevel_.load(std::memory_order_acquire);
97  }
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
LogLevel folly::LogCategory::getEffectiveLevelRelaxed ( ) const
inline

Get the effective log level using std::memory_order_relaxed.

This is primarily used for log message checks. Most other callers should use getEffectiveLevel() above to be more conservative with regards to memory ordering.

Definition at line 106 of file LogCategory.h.

References effectiveLevel_.

106  {
107  return effectiveLevel_.load(std::memory_order_relaxed);
108  }
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
std::vector< std::shared_ptr< LogHandler > > folly::LogCategory::getHandlers ( ) const

Get the list of LogHandlers attached to this category.

Definition at line 144 of file LogCategory.cpp.

References handlers_.

Referenced by getDB().

144  {
145  return *(handlers_.rlock());
146 }
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
LogLevel folly::LogCategory::getLevel ( ) const
inline

Get the level for this log category.

Definition at line 73 of file LogCategory.h.

References FLAG_INHERIT, and level_.

73  {
74  return static_cast<LogLevel>(
75  level_.load(std::memory_order_acquire) & ~FLAG_INHERIT);
76  }
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LogLevel
Definition: LogLevel.h:38
std::pair<LogLevel, bool> folly::LogCategory::getLevelInfo ( ) const
inline

Get the log level and inheritance flag.

Definition at line 81 of file LogCategory.h.

References FLAG_INHERIT, level_, and folly::value().

81  {
82  auto value = level_.load(std::memory_order_acquire);
83  return {static_cast<LogLevel>(value & ~FLAG_INHERIT),
84  bool(value & FLAG_INHERIT)};
85  }
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LogLevel
Definition: LogLevel.h:38
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
const std::string& folly::LogCategory::getName ( ) const
inline

Get the name of this log category.

Definition at line 66 of file LogCategory.h.

References name_.

66  {
67  return name_;
68  }
const std::string name_
Definition: LogCategory.h:267
bool folly::LogCategory::logCheck ( LogLevel  level) const
inline

Check whether this Logger or any of its parent Loggers would do anything with a log message at the given level.

Definition at line 114 of file LogCategory.h.

References effectiveLevel_, and setLevel().

114  {
115  // We load the effective level using std::memory_order_relaxed.
116  //
117  // We want to make log checks as lightweight as possible. It's fine if we
118  // don't immediately respond to changes made to the log level from other
119  // threads. We can wait until some other operation triggers a memory
120  // barrier before we honor the new log level setting. No other memory
121  // accesses depend on the log level value. Callers should not rely on all
122  // other threads to immediately stop logging as soon as they decrease the
123  // log level for a given category.
124  return effectiveLevel_.load(std::memory_order_relaxed) <= level;
125  }
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
LogCategory& folly::LogCategory::operator= ( LogCategory const &  )
privatedelete
LogCategory& folly::LogCategory::operator= ( LogCategory &&  )
privatedelete
void folly::LogCategory::parentLevelUpdated ( LogLevel  parentEffectiveLevel)
private

Definition at line 227 of file LogCategory.cpp.

References FLAG_INHERIT, level_, min, uint32_t, and updateEffectiveLevel().

Referenced by updateEffectiveLevel().

227  {
228  uint32_t levelValue = level_.load(std::memory_order_acquire);
229  auto inherit = (levelValue & FLAG_INHERIT);
230  if (!inherit) {
231  return;
232  }
233 
234  auto myLevel = static_cast<LogLevel>(levelValue & ~FLAG_INHERIT);
235  auto newEffectiveLevel = std::min(myLevel, parentEffectiveLevel);
236  updateEffectiveLevel(newEffectiveLevel);
237 }
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LogLevel min
Definition: LogLevel.cpp:30
LogLevel
Definition: LogLevel.h:38
void updateEffectiveLevel(LogLevel newEffectiveLevel)
void folly::LogCategory::processMessage ( const LogMessage message) const
private

Definition at line 74 of file LogCategory.cpp.

References folly::exceptionStr(), handlers_, folly::LoggerDB::internalWarning(), name_, parent_, processMessage(), and uint32_t.

Referenced by admitMessage(), and processMessage().

74  {
75  // Make a copy of any attached LogHandlers, so we can release the handlers_
76  // lock before holding them.
77  //
78  // In the common case there will only be a small number of handlers. Use a
79  // std::array in this case to avoid a heap allocation for the vector.
80  const std::shared_ptr<LogHandler>* handlers = nullptr;
81  size_t numHandlers = 0;
82  constexpr uint32_t kSmallOptimizationSize = 5;
83  std::array<std::shared_ptr<LogHandler>, kSmallOptimizationSize> handlersArray;
84  std::vector<std::shared_ptr<LogHandler>> handlersVector;
85  {
86  auto lockedHandlers = handlers_.rlock();
87  numHandlers = lockedHandlers->size();
88  if (numHandlers <= kSmallOptimizationSize) {
89  for (size_t n = 0; n < numHandlers; ++n) {
90  handlersArray[n] = (*lockedHandlers)[n];
91  }
92  handlers = handlersArray.data();
93  } else {
94  handlersVector = *lockedHandlers;
95  handlers = handlersVector.data();
96  }
97  }
98 
99  for (size_t n = 0; n < numHandlers; ++n) {
100  try {
101  handlers[n]->handleMessage(message, this);
102  } catch (const std::exception& ex) {
103  // Use LoggerDB::internalWarning() to report the error, but continue
104  // trying to log the message to any other handlers attached to ourself or
105  // one of our parent categories.
107  __FILE__,
108  __LINE__,
109  "log handler for category \"",
110  name_,
111  "\" threw an error: ",
112  folly::exceptionStr(ex));
113  }
114  }
115 
116  // Propagate the message up to our parent LogCategory.
117  //
118  // Maybe in the future it might be worth adding a flag to control if a
119  // LogCategory should propagate messages to its parent or not. (This would
120  // be similar to log4j's "additivity" flag.)
121  // For now I don't have a strong use case for this.
122  if (parent_) {
124  }
125 }
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
Definition: test.c:42
void processMessage(const LogMessage &message) const
Definition: LogCategory.cpp:74
fbstring exceptionStr(const std::exception &e)
const std::string name_
Definition: LogCategory.h:267
LogCategory *const parent_
Definition: LogCategory.h:262
static void internalWarning(folly::StringPiece file, int lineNumber, Args &&...args) noexcept
Definition: LoggerDB.h:201
void folly::LogCategory::registerXlogLevel ( std::atomic< LogLevel > *  levelPtr)

Register a std::atomic<LogLevel> value used by XLOG*() macros to check the effective level for this category.

The LogCategory will keep this value updated whenever its effective log level changes.

This function should only be invoked by LoggerDB, and the LoggerDB lock must be held when calling it.

Definition at line 239 of file LogCategory.cpp.

References xlogLevels_.

Referenced by getDB().

239  {
240  xlogLevels_.push_back(levelPtr);
241 }
std::vector< std::atomic< LogLevel > * > xlogLevels_
Definition: LogCategory.h:298
void folly::LogCategory::replaceHandlers ( std::vector< std::shared_ptr< LogHandler >>  handlers)

Replace the list of LogHandlers with a completely new list.

Definition at line 148 of file LogCategory.cpp.

References handlers_.

Referenced by getDB(), and folly::LoggerDB::updateConfig().

149  {
150  return handlers_.wlock()->swap(handlers);
151 }
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
void folly::LogCategory::setLevel ( LogLevel  level,
bool  inherit = true 
)

Set the log level for this LogCategory.

Messages logged to a specific log category will be ignored unless the message log level is greater than the LogCategory's effective log level.

If inherit is true, LogCategory's effective log level is the minimum of its level and its parent category's effective log level. If inherit is false, the LogCategory's effective log level is simply its log level. (Setting inherit to false is necessary if you want a child LogCategory to use a less verbose level than its parent categories.)

Definition at line 165 of file LogCategory.cpp.

References db_, and folly::LoggerDB::setLevel().

Referenced by logCheck().

165  {
166  // We have to set the level through LoggerDB, since we require holding
167  // the LoggerDB lock to iterate through our children in case our effective
168  // level changes.
169  db_->setLevel(this, level, inherit);
170 }
LoggerDB *const db_
Definition: LogCategory.h:280
void setLevel(folly::StringPiece name, LogLevel level, bool inherit=true)
Definition: LoggerDB.cpp:147
void folly::LogCategory::setLevelLocked ( LogLevel  level,
bool  inherit 
)

Note: setLevelLocked() may only be called while holding the LoggerDB loggersByName_ lock. It is safe to call this while holding the loggersByName_ lock in read-mode; holding it exclusively is not required.

This method should only be invoked by LoggerDB.

Definition at line 172 of file LogCategory.cpp.

References folly::constexpr_clamp(), FLAG_INHERIT, getEffectiveLevel(), level_, folly::MAX_LEVEL, min, folly::MIN_LEVEL, parent_, uint32_t, and updateEffectiveLevel().

Referenced by getDB(), folly::LoggerDB::setLevel(), and folly::LoggerDB::updateConfig().

172  {
173  // Clamp the value to MIN_LEVEL and MAX_LEVEL.
174  //
175  // This makes sure that UNINITIALIZED is always less than any valid level
176  // value, and that level values cannot conflict with our flag bits.
178 
179  // Make sure the inherit flag is always off for the root logger.
180  if (!parent_) {
181  inherit = false;
182  }
183  auto newValue = static_cast<uint32_t>(level);
184  if (inherit) {
185  newValue |= FLAG_INHERIT;
186  }
187 
188  // Update the stored value
189  uint32_t oldValue = level_.exchange(newValue, std::memory_order_acq_rel);
190 
191  // Break out early if the value has not changed.
192  if (oldValue == newValue) {
193  return;
194  }
195 
196  // Update the effective log level
197  LogLevel newEffectiveLevel;
198  if (inherit) {
199  newEffectiveLevel = std::min(level, parent_->getEffectiveLevel());
200  } else {
201  newEffectiveLevel = level;
202  }
203  updateEffectiveLevel(newEffectiveLevel);
204 }
std::atomic< uint32_t > level_
Definition: LogCategory.h:254
LogLevel min
Definition: LogLevel.cpp:30
LogLevel
Definition: LogLevel.h:38
constexpr T const & constexpr_clamp(T const &v, T const &lo, T const &hi, Less less)
Definition: ConstexprMath.h:89
LogLevel getEffectiveLevel() const
Definition: LogCategory.h:95
LogCategory *const parent_
Definition: LogCategory.h:262
void updateEffectiveLevel(LogLevel newEffectiveLevel)
void folly::LogCategory::updateEffectiveLevel ( LogLevel  newEffectiveLevel)
private

Definition at line 206 of file LogCategory.cpp.

References child, effectiveLevel_, firstChild_, nextSibling_, parentLevelUpdated(), and xlogLevels_.

Referenced by parentLevelUpdated(), and setLevelLocked().

206  {
207  auto oldEffectiveLevel =
208  effectiveLevel_.exchange(newEffectiveLevel, std::memory_order_acq_rel);
209  // Break out early if the value did not change.
210  if (newEffectiveLevel == oldEffectiveLevel) {
211  return;
212  }
213 
214  // Update all of the values in xlogLevels_
215  for (auto* levelPtr : xlogLevels_) {
216  levelPtr->store(newEffectiveLevel, std::memory_order_release);
217  }
218 
219  // Update all children loggers
221  while (child != nullptr) {
222  child->parentLevelUpdated(newEffectiveLevel);
223  child = child->nextSibling_;
224  }
225 }
LogCategory(LoggerDB *db)
Definition: LogCategory.cpp:32
std::vector< std::atomic< LogLevel > * > xlogLevels_
Definition: LogCategory.h:298
LogCategory * firstChild_
Definition: LogCategory.h:288
std::atomic< LogLevel > effectiveLevel_
Definition: LogCategory.h:246
folly::Function< void()> child
Definition: AtFork.cpp:35
void parentLevelUpdated(LogLevel parentEffectiveLevel)
void folly::LogCategory::updateHandlers ( const std::unordered_map< std::shared_ptr< LogHandler >, std::shared_ptr< LogHandler >> &  handlerMap)

Update the LogHandlers attached to this LogCategory by replacing currently attached handlers with new LogHandler objects.

The handlerMap argument is a map of (old_handler -> new_handler) If any of the LogHandlers currently attached to this category are found in the handlerMap, replace them with the new handler indicated in the map.

This is used when the LogHandler configuration is changed requiring one or more LogHandler objects to be replaced with new ones.

Definition at line 153 of file LogCategory.cpp.

References folly::get_ptr(), handlers_, and ptr.

Referenced by getDB().

155  {
156  auto handlers = handlers_.wlock();
157  for (auto& entry : *handlers) {
158  auto* ptr = get_ptr(handlerMap, entry);
159  if (ptr) {
160  entry = *ptr;
161  }
162  }
163 }
const Map::mapped_type * get_ptr(const Map &map, const Key &key)
Definition: MapUtil.h:169
folly::Synchronized< std::vector< std::shared_ptr< LogHandler > > > handlers_
Definition: LogCategory.h:272
void * ptr

Member Data Documentation

LoggerDB* const folly::LogCategory::db_ {nullptr}
private

A pointer to the LoggerDB that we belong to.

This is almost always the main LoggerDB singleton. Unit tests are the main place where we use other LoggerDB objects besides the singleton.

Definition at line 280 of file LogCategory.h.

Referenced by admitMessage(), getDB(), LogCategory(), and setLevel().

std::atomic<LogLevel> folly::LogCategory::effectiveLevel_ {LogLevel::MAX_LEVEL}
private

The minimum log level of this category and all of its parents.

Definition at line 246 of file LogCategory.h.

Referenced by getEffectiveLevel(), getEffectiveLevelRelaxed(), logCheck(), and updateEffectiveLevel().

LogCategory* folly::LogCategory::firstChild_ {nullptr}
private

Pointers to children and sibling loggers. These pointers should only ever be accessed while holding the LoggerDB::loggersByName_ lock. (These are only modified when creating new loggers, which occurs with the main LoggerDB lock held.)

Definition at line 288 of file LogCategory.h.

Referenced by LogCategory(), and updateEffectiveLevel().

folly::Synchronized<std::vector<std::shared_ptr<LogHandler> > > folly::LogCategory::handlers_
private

The list of LogHandlers attached to this category.

Definition at line 272 of file LogCategory.h.

Referenced by addHandler(), clearHandlers(), getHandlers(), processMessage(), replaceHandlers(), and updateHandlers().

std::atomic<uint32_t> folly::LogCategory::level_ {0}
private

The current log level for this category.

The most significant bit is used to indicate if this logger should inherit its parent's effective log level.

Definition at line 254 of file LogCategory.h.

Referenced by getLevel(), getLevelInfo(), LogCategory(), parentLevelUpdated(), and setLevelLocked().

const std::string folly::LogCategory::name_
private

Our log category name.

Definition at line 267 of file LogCategory.h.

Referenced by getName(), LogCategory(), and processMessage().

LogCategory* folly::LogCategory::nextSibling_ {nullptr}
private

Definition at line 289 of file LogCategory.h.

Referenced by LogCategory(), and updateEffectiveLevel().

LogCategory* const folly::LogCategory::parent_ {nullptr}
private

Our parent LogCategory in the category hierarchy.

For instance, if our log name is "foo.bar.abc", our parent category is "foo.bar".

Definition at line 262 of file LogCategory.h.

Referenced by LogCategory(), processMessage(), and setLevelLocked().

std::vector<std::atomic<LogLevel>*> folly::LogCategory::xlogLevels_
private

A list of LogLevel values used by XLOG*() statements for this LogCategory. The XLOG*() statements will check these values. We ensure they are kept up-to-date each time the effective log level changes for this category.

This list may only be accessed while holding the main LoggerDB lock.

Definition at line 298 of file LogCategory.h.

Referenced by registerXlogLevel(), and updateEffectiveLevel().


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