Cogs.Foundation
Loading...
Searching...
No Matches
Consumer.h
Go to the documentation of this file.
1#pragma once
2
3#include "../Platform/Threads.h"
4
5namespace Cogs {
6
7 namespace Logging {
8 enum class Category;
9
19 public:
20 Consumer();
21 virtual ~Consumer();
22
23 virtual void consumeMessage(const char* source, Category category, uint32_t errorNumber, const char* message, const char* filename, int lineNumber) = 0;
24
25 Category getMinimumCategory() const { return minimumCategory; }
26 void setMinimumCategory(Category category);
27
28 void enableFilenames(bool enable) { outputFilenames = enable; }
29
31 static void setDefaultMinimumCategory(Category category);
32
33 static const char* getCategoryName(Category category);
34
35 static const char* getCategoryNameColor(Category category);
36
37 protected:
39 bool outputFilenames = false;
40
41 private:
44 };
45 }
46}
#define COGSFOUNDATION_API
Definition: FoundationBase.h:31
Consumer is the base class for objects that want to consume log messages through the LogManager.
Definition: Consumer.h:18
Mutex mutex
Mutex available for implementations to use if needed.
Definition: Consumer.h:38
static Category defaultMinimumCategory
Definition: Consumer.h:43
Category getMinimumCategory() const
Definition: Consumer.h:25
virtual void consumeMessage(const char *source, Category category, uint32_t errorNumber, const char *message, const char *filename, int lineNumber)=0
Category minimumCategory
Definition: Consumer.h:42
void enableFilenames(bool enable)
Definition: Consumer.h:28
Category
Logging categories used to filter log messages.
Definition: LogManager.h:31
Main Cogs namespace.
Definition: MortonCode.h:5
std::mutex Mutex
Definition: Threads.h:62