8#ifndef INCLUDED_BALL_LOGGERMANAGER
9#define INCLUDED_BALL_LOGGERMANAGER
942#include <balscm_version.h>
970#include <bsl_functional.h>
972#include <bsl_memory.h>
974#include <bsl_string_view.h>
1024 d_userFieldsPopulator;
1028 *d_attributeCollectors_p;
1040 char *d_scratchBuffer_p;
1046 int d_scratchBufferSize;
1086 int scratchBufferSize,
1123 void logMessage(
const Category& category,
1163 const char *fileName,
1165 const char *message);
1192#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1242#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1302#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1312 static bool s_isSingletonOwned;
1331 d_defaultThresholds;
1336 d_defaultThresholdsLock;
1344 d_factoryThresholdLevels;
1349 d_userFieldsPopulator;
1354 d_attributeCollectors;
1362 unsigned int d_maxNumCategoriesMinusOne;
1374 d_publishAllCallback;
1382 int d_scratchBufferSize;
1389 d_defaultLoggersLock;
1412 static void initSingletonImpl(
1418#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1448#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1491#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1547 bool adoptSingleton =
false);
1624#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1643 int scratchBufferSize,
1661 int scratchBufferSize,
1699 int triggerAllLevel);
1735 const char *categoryName);
1756 int triggerAllLevel);
1801 template <
class t_OBSERVER>
1805#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1860 int triggerAllLevel);
1911 template <
class t_CATEGORY_VISITOR>
1923 template <
class t_OBSERVER_VISITOR>
1964 template <
class t_OBSERVER>
2002#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2026 template <
class t_CATEGORY_VISITOR>
2038 template <
class t_OBSERVER_VISITOR>
2062 const char *categoryName)
const;
2082#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2121#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2170 operator const void *()
const;
2231 operator const void *()
const;
2245#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2249 return d_scratchBuffer_p;
2269 return d_scratchBufferSize;
2275 return d_recordPool.numObjects() - d_recordPool.numAvailableObjects();
2292 return *s_singleton_p;
2301 return *d_defaultCategory_p;
2315 d_observer->deregisterAllObservers();
2321 return d_observer->deregisterObserver(observerName);
2335 return d_observer->findObserver(observerName);
2338template <
class t_OBSERVER>
2343 return d_observer->findObserver(result, observerName);
2351 return d_observer->registerObserver(
observer, observerName);
2360 return d_attributeCollectors.
addCollector(collector, collectorName);
2367 d_defaultThresholdLevels = d_factoryThresholdLevels;
2375 return d_categoryManager.
addRule(value);
2410template <
class t_CATEGORY_VISITOR>
2417template <
class t_OBSERVER_VISITOR>
2422 d_observer->visitObservers(
2430 return d_allocator_p;
2436 return *d_defaultCategory_p;
2442 return d_defaultThresholdLevels.
passLevel();
2472template <
class t_OBSERVER>
2480 return observerPtr->
findObserver(result, observerName);
2486 return static_cast<int>(d_maxNumCategoriesMinusOne) + 1;
2492 return d_categoryManager.
length();
2498 return d_categoryManager.
ruleSet();
2501template <
class t_CATEGORY_VISITOR>
2508template <
class t_OBSERVER_VISITOR>
2513 d_observer->visitObservers(
2522#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2524LoggerManagerScopedGuard::LoggerManagerScopedGuard(
2534LoggerManagerScopedGuard::LoggerManagerScopedGuard(
2547#ifndef BDE_OMIT_INTERNAL_DEPRECATED
2555LoggerManagerCategoryIter::LoggerManagerCategoryIter(
2557: d_iter(loggerManager.d_categoryManager)
2570LoggerManagerCategoryIter::operator
const void *()
const
2587LoggerManagerCategoryManip::LoggerManagerCategoryManip(
2589: d_manip(&loggerManager->d_categoryManager)
2608LoggerManagerCategoryManip::operator
const void *()
const
Definition ball_attributecollectorregistry.h:182
int addCollector(const Collector &collector, const bsl::string_view &name)
int removeCollector(const bsl::string_view &name)
Definition ball_broadcastobserver.h:226
bsl::shared_ptr< Observer > findObserver(const bsl::string_view &observerName)
Definition ball_category.h:362
Definition ball_categorymanager.h:503
Definition ball_categorymanager.h:560
void advance()
Definition ball_categorymanager.h:727
Definition ball_categorymanager.h:231
const RuleSet & ruleSet() const
Definition ball_categorymanager.h:656
int addRule(const Rule &ruleToAdd)
int addRules(const RuleSet &ruleSet)
int removeRules(const RuleSet &ruleSet)
int removeRule(const Rule &ruleToRemove)
int length() const
Definition ball_categorymanager.h:642
void visitCategories(const t_CATEGORY_VISITOR &visitor)
Definition ball_categorymanager.h:630
Definition ball_category.h:184
Definition ball_loggermanager.h:2134
const Category & operator()() const
Definition ball_loggermanager.h:2576
~LoggerManagerCategoryIter()=default
void operator++()
Definition ball_loggermanager.h:2563
Definition ball_loggermanager.h:2190
~LoggerManagerCategoryManip()=default
Category & operator()()
Definition ball_loggermanager.h:2601
void advance()
Definition ball_loggermanager.h:2595
Definition ball_loggermanagerconfiguration.h:281
TriggerMarkers
Definition ball_loggermanagerconfiguration.h:326
LogOrder
Definition ball_loggermanagerconfiguration.h:303
Definition ball_loggermanager.h:2073
~LoggerManagerScopedGuard()
Definition ball_loggermanager.h:2542
Definition ball_loggermanager.h:1257
static LoggerManager & initSingleton(Observer *observer, const LoggerManagerConfiguration &configuration, bslma::Allocator *globalAllocator=0)
int defaultPassThresholdLevel() const
Return the default pass threshold level of this logger manager.
Definition ball_loggermanager.h:2440
int addRules(const RuleSet &ruleSet)
Definition ball_loggermanager.h:2379
BroadcastObserver::ObserverRegistry ObserverRegistry
Definition ball_loggermanager.h:1295
Category * setCategory(const char *categoryName, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
int defaultTriggerThresholdLevel() const
Return the default trigger threshold level of this logger manager.
Definition ball_loggermanager.h:2458
int defaultTriggerAllThresholdLevel() const
Definition ball_loggermanager.h:2452
int numCategories() const
Definition ball_loggermanager.h:2490
bool isCategoryEnabled(const Category *category, int severity) const
bsl::shared_ptr< Observer > findObserver(const bsl::string_view &observerName)
Definition ball_loggermanager.h:2333
int deregisterObserver(const bsl::string_view &observerName)
Definition ball_loggermanager.h:2319
int defaultRecordThresholdLevel() const
Return the default record threshold level of this logger manager.
Definition ball_loggermanager.h:2446
LoggerManagerConfiguration::UserFieldsPopulatorCallback UserFieldsPopulatorCallback
Definition ball_loggermanager.h:1283
bslma::Allocator * allocator() const
Definition ball_loggermanager.h:2428
AttributeCollectorRegistry::Visitor AttributeVisitor
Definition ball_loggermanager.h:1291
int registerAttributeCollector(const AttributeCollector &collector, const bsl::string_view &collectorName)
Definition ball_loggermanager.h:2356
Logger * allocateLogger(RecordBuffer *buffer, int scratchBufferSize, Observer *observer)
const ThresholdAggregate & defaultThresholdLevels() const
LoggerManagerConfiguration::CategoryNameFilterCallback CategoryNameFilterCallback
Definition ball_loggermanager.h:1265
~LoggerManager()
Destroy this logger manager.
const Category * setCategory(const char *categoryName)
Definition ball_loggermanager.h:2305
void setDefaultThresholdLevelsCallback(DefaultThresholdLevelsCallback *callback)
void removeAllRules()
Remove every rule from the set of rules maintained by this object.
Definition ball_loggermanager.h:2385
int thresholdLevelsForNewCategory(ThresholdAggregate *levels, const char *categoryName) const
static char * obtainMessageBuffer(bslmt::Mutex **mutex, int *bufferSize)
void publishAll()
Definition ball_loggermanager.h:2405
static LoggerManager & initSingleton(Observer *observer, bslma::Allocator *globalAllocator=0)
int setDefaultThresholdLevels(int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
static Record * getRecord(const char *fileName, int lineNumber)
const UserFieldsPopulatorCallback * userFieldsPopulatorCallback() const
void deregisterAllObservers()
Definition ball_loggermanager.h:2313
Logger * allocateLogger(RecordBuffer *buffer, int scratchBufferSize)
void resetDefaultThresholdLevels()
Definition ball_loggermanager.h:2365
void visitCategories(const t_CATEGORY_VISITOR &visitor)
Definition ball_loggermanager.h:2412
void setMaxNumCategories(int length)
Logger * allocateLogger(RecordBuffer *buffer)
const Category * setCategory(CategoryHolder *categoryHolder, const char *categoryName)
Category * addCategory(const char *categoryName, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
void visitObservers(BSLS_COMPILERFEATURES_FORWARD_REF(t_OBSERVER_VISITOR) visitor)
Definition ball_loggermanager.h:2419
int removeRule(const Rule &value)
Definition ball_loggermanager.h:2391
int addRule(const Rule &value)
Definition ball_loggermanager.h:2373
static void logMessage(int severity, Record *record)
void setCategoryThresholdsToFactoryDefaults(Category *category)
const Category * lookupCategory(const char *categoryName) const
static LoggerManager & singleton()
Definition ball_loggermanager.h:2290
static int initSingleton(LoggerManager *singleton, bool adoptSingleton=false)
int deregisterAttributeCollector(const bsl::string_view &collectorName)
Definition ball_loggermanager.h:2325
AttributeCollectorRegistry::Collector AttributeCollector
Definition ball_loggermanager.h:1287
Logger * allocateLogger(RecordBuffer *buffer, const bsl::shared_ptr< Observer > &observer)
LoggerManagerConfiguration::DefaultThresholdLevelsCallback DefaultThresholdLevelsCallback
Definition ball_loggermanager.h:1271
Category * lookupCategory(const char *categoryName)
int registerObserver(const bsl::shared_ptr< Observer > &observer, const bsl::string_view &observerName)
Definition ball_loggermanager.h:2348
int maxNumCategories() const
Definition ball_loggermanager.h:2484
void setLogger(Logger *logger)
Logger * allocateLogger(RecordBuffer *buffer, Observer *observer)
int removeRules(const RuleSet &ruleSet)
Definition ball_loggermanager.h:2397
static LoggerManager & initSingleton(const LoggerManagerConfiguration &configuration, bslma::Allocator *globalAllocator=0)
Logger * allocateLogger(RecordBuffer *buffer, int scratchBufferSize, const bsl::shared_ptr< Observer > &observer)
static bool isInitialized()
Definition ball_loggermanager.h:2284
static void createLoggerManager(bslma::ManagedPtr< LoggerManager > *manager, Observer *observer, const LoggerManagerConfiguration &configuration, bslma::Allocator *basicAllocator=0)
Category & defaultCategory()
Definition ball_loggermanager.h:2299
static bslma::ManagedPtr< char > obtainMessageBuffer(int *bufferSize)
const Observer * observer() const
static void shutDownSingleton()
LoggerManager(const LoggerManagerConfiguration &configuration, bslma::Allocator *globalAllocator=0)
void setCategoryThresholdsToCurrentDefaults(Category *category)
static LoggerManager & initSingleton(bslma::Allocator *globalAllocator=0)
Logger::PublishAllTriggerCallback PublishAllTriggerCallback
Definition ball_loggermanager.h:1277
static void createLoggerManager(bslma::ManagedPtr< LoggerManager > *manager, const LoggerManagerConfiguration &configuration, bslma::Allocator *basicAllocator=0)
void deallocateLogger(Logger *logger)
const RuleSet & ruleSet() const
Definition ball_loggermanager.h:2496
Definition ball_loggermanager.h:993
int numRecordsInUse() const
Definition ball_loggermanager.h:2273
void logMessage(const Category &category, int severity, Record *record)
LoggerManagerConfiguration::UserFieldsPopulatorCallback UserFieldsPopulatorCallback
Definition ball_loggermanager.h:1002
void removeAll()
Remove all log records from the record buffer of this logger.
Definition ball_loggermanager.h:2260
Record * getRecord(const char *fileName, int lineNumber)
void logMessage(const Category &category, int severity, const char *fileName, int lineNumber, const char *message)
bsl::function< void(Transmission::Cause)> PublishAllTriggerCallback
Definition ball_loggermanager.h:1007
char * obtainMessageBuffer(bslmt::Mutex **mutex, int *bufferSize)
char * messageBuffer()
Definition ball_loggermanager.h:2247
void publish()
Definition ball_loggermanager.h:2254
int messageBufferSize() const
Definition ball_loggermanager.h:2267
bslma::ManagedPtr< char > obtainMessageBuffer(int *bufferSize)
Definition ball_observer.h:235
Definition ball_recordbuffer.h:288
virtual void removeAll()=0
Definition ball_record.h:178
Definition ball_ruleset.h:151
Definition ball_rule.h:177
Definition ball_thresholdaggregate.h:97
int triggerLevel() const
Return the trigger level of this threshold aggregate.
Definition ball_thresholdaggregate.h:260
int recordLevel() const
Return the record level of this threshold aggregate.
Definition ball_thresholdaggregate.h:248
int passLevel() const
Return the pass level of this threshold aggregate.
Definition ball_thresholdaggregate.h:254
int triggerAllLevel() const
Return the trigger-all level of this threshold aggregate.
Definition ball_thresholdaggregate.h:266
Definition bdlcc_objectpool.h:460
Definition bdlcc_sharedobjectpool.h:366
Definition bdlma_concurrentpool.h:332
Definition bslstl_stringview.h:441
Definition bslstl_map.h:619
Definition bslstl_set.h:657
Definition bslstl_sharedptr.h:1830
element_type * get() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_sharedptr.h:5574
Definition bslma_allocator.h:457
Definition bslma_managedptr.h:1182
Definition bslmt_mutex.h:315
Definition bslmt_readerwritermutex.h:244
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition ball_administration.h:214
Cause
Definition ball_transmission.h:213
@ e_MANUAL_PUBLISH
Definition ball_transmission.h:217
@ e_MANUAL_PUBLISH_ALL
Definition ball_transmission.h:218
bsl::function< void(void *, bslma::Allocator *)> DefaultCreator
Definition bdlcc_objectpool.h:419