Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Log Namespace Reference

Enumerations

enum class  Category { error , debug , metrics , num }
 

Functions

LOGGING_API void setCategoryEnabled (Category category, bool enable)
 
LOGGING_API bool isCategoryEnabled (Category category)
 
LOGGING_API void printf (Category category, const char *format,...)
 

Enumeration Type Documentation

◆ Category

enum class Log::Category
strong
Enumerator
error 
debug 
metrics 
num 

Definition at line 14 of file Logging.h.

15 {
16 error,
17 debug,
18 metrics,
19 num
20 };
bool debug

Function Documentation

◆ isCategoryEnabled()

bool Log::isCategoryEnabled ( Category category)

Definition at line 25 of file Logging.cpp.

26 {
27 WAVM_ASSERT_THROW(category < Category::num);
28 return categoryEnabled[(Uptr)category];
29 }
PointerIntHelper< sizeof(size_t)>::UnsignedIntType Uptr
Definition BasicTypes.h:22
#define WAVM_ASSERT_THROW(cond)
Definition Errors.h:29

◆ printf()

void Log::printf ( Category category,
const char * format,
... )

Definition at line 30 of file Logging.cpp.

31 {
32 if(categoryEnabled[(Uptr)category])
33 {
34 va_list varArgs;
35 va_start(varArgs,format);
36 vfprintf(stdout,format,varArgs);
37 fflush(stdout);
38 va_end(varArgs);
39 }
40 }
cmd_format format
Here is the caller graph for this function:

◆ setCategoryEnabled()

void Log::setCategoryEnabled ( Category category,
bool enable )

Definition at line 20 of file Logging.cpp.

21 {
22 WAVM_ASSERT_THROW(category < Category::num);
23 categoryEnabled[(Uptr)category] = enable;
24 }