update cmake logging config and README.md
parent
f325d7aa83
commit
fa55b5e929
|
@ -7,13 +7,13 @@ option(BUILD_STD "Build the BLT standard utilities." ON)
|
||||||
option(BUILD_PROFILING "Build the BLT profiler extension" ON)
|
option(BUILD_PROFILING "Build the BLT profiler extension" ON)
|
||||||
option(BUILD_NBT "Build the BLT NBT + eNBT extension" ON)
|
option(BUILD_NBT "Build the BLT NBT + eNBT extension" ON)
|
||||||
option(BUILD_TESTS "Build the BLT test set" OFF)
|
option(BUILD_TESTS "Build the BLT test set" OFF)
|
||||||
option(BLT_ENABLE_LOGGING "Enable blt::logging (all macros and will safely disable logging function!)" ON)
|
option(BLT_DISABLE_LOGGING "Disable blt::logging (all macros and will safely disable logging function!)" OFF)
|
||||||
option(BLT_ENABLE_TRACE "Enable blt::logging BLT_TRACE macro" ON)
|
option(BLT_DISABLE_TRACE "Disable blt::logging BLT_TRACE macro" OFF)
|
||||||
option(BLT_ENABLE_DEBUG "Enable blt::logging BLT_DEBUG macro" ON)
|
option(BLT_DISABLE_DEBUG "Disable blt::logging BLT_DEBUG macro" OFF)
|
||||||
option(BLT_ENABLE_INFO "Enable blt::logging BLT_INFO macro" ON)
|
option(BLT_DISABLE_INFO "Disable blt::logging BLT_INFO macro" OFF)
|
||||||
option(BLT_ENABLE_WARN "Enable blt::logging BLT_WARN macro" ON)
|
option(BLT_DISABLE_WARN "Disable blt::logging BLT_WARN macro" OFF)
|
||||||
option(BLT_ENABLE_ERROR "Enable blt::logging BLT_ERROR macro" ON)
|
option(BLT_DISABLE_ERROR "Disable blt::logging BLT_ERROR macro" OFF)
|
||||||
option(BLT_ENABLE_FATAL "Enable blt::logging BLT_FATAL macro" ON)
|
option(BLT_DISABLE_FATAL "Disable blt::logging BLT_FATAL macro" OFF)
|
||||||
|
|
||||||
configure_file(include/blt/config.h.in config/blt/config.h @ONLY)
|
configure_file(include/blt/config.h.in config/blt/config.h @ONLY)
|
||||||
|
|
||||||
|
|
18
README.md
18
README.md
|
@ -1,10 +1,22 @@
|
||||||
# **BLT v0.2a**
|
# **BLT v0.6.0a**
|
||||||
|
A common utilities library I find useful
|
||||||
|
|
||||||
![Icon](icon_large.png)
|
![Icon](icon_large.png)
|
||||||
|
|
||||||
### A common utilties library of missing stl features. (and more!)
|
---
|
||||||
|
|
||||||
# **Features**
|
# Specialties
|
||||||
|
## blt::logging.v2
|
||||||
|
Found in the header file `include/std/logging.h`, blt::logging is a fast and simple
|
||||||
|
single header logging library which can be used independently of BLT. Just include
|
||||||
|
the header file anywhere in your project and in ONE cpp file define `#define BLT_LOGGING_IMPLEMENTATION`.
|
||||||
|
If you are using BLT as a CMake library (as you should!) this is done for you.
|
||||||
|
- ### Compile Time Config
|
||||||
|
- Using CMake
|
||||||
|
-
|
||||||
|
---
|
||||||
|
|
||||||
|
# **Features / Examples**
|
||||||
- ## Data Structures
|
- ## Data Structures
|
||||||
- Queue / Stack
|
- Queue / Stack
|
||||||
- faster than std::queue / std::stack
|
- faster than std::queue / std::stack
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
#define BLT_CONFIG_H
|
#define BLT_CONFIG_H
|
||||||
|
|
||||||
#cmakedefine ZLIB_FOUND
|
#cmakedefine ZLIB_FOUND
|
||||||
#cmakedefine BLT_ENABLE_LOGGING
|
#cmakedefine BLT_DISABLE_LOGGING
|
||||||
#cmakedefine BLT_ENABLE_TRACE
|
#cmakedefine BLT_DISABLE_TRACE
|
||||||
#cmakedefine BLT_ENABLE_DEBUG
|
#cmakedefine BLT_DISABLE_DEBUG
|
||||||
#cmakedefine BLT_ENABLE_INFO
|
#cmakedefine BLT_DISABLE_INFO
|
||||||
#cmakedefine BLT_ENABLE_WARN
|
#cmakedefine BLT_DISABLE_WARN
|
||||||
#cmakedefine BLT_ENABLE_ERROR
|
#cmakedefine BLT_DISABLE_ERROR
|
||||||
#cmakedefine BLT_ENABLE_FATAL
|
#cmakedefine BLT_DISABLE_FATAL
|
||||||
|
|
||||||
#endif // BLT_CONFIG_H
|
#endif // BLT_CONFIG_H
|
|
@ -615,8 +615,9 @@ namespace blt::logging {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BLT_ENABLE_LOGGING) || defined(BLT_DISABLE_LOGGING)
|
#ifdef BLT_DISABLE_LOGGING
|
||||||
#define BLT_LOG(format, level, ...)
|
#define BLT_LOG(format, level, ...)
|
||||||
|
#define BLT_LOG_STREAM(level)
|
||||||
#define BLT_TRACE(format, ...)
|
#define BLT_TRACE(format, ...)
|
||||||
#define BLT_DEBUG(format, ...)
|
#define BLT_DEBUG(format, ...)
|
||||||
#define BLT_INFO(format, ...)
|
#define BLT_INFO(format, ...)
|
||||||
|
@ -626,7 +627,7 @@ namespace blt::logging {
|
||||||
#else
|
#else
|
||||||
#define BLT_LOG(format, level, ...) log(format, level, __FILE__, __LINE__, ##__VA_ARGS__)
|
#define BLT_LOG(format, level, ...) log(format, level, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||||
#define BLT_LOG_STREAM(level) blt::logging::logger{level, __FILE__, __LINE__}
|
#define BLT_LOG_STREAM(level) blt::logging::logger{level, __FILE__, __LINE__}
|
||||||
#ifndef BLT_ENABLE_TRACE
|
#ifdef BLT_DISABLE_TRACE
|
||||||
#define BLT_TRACE(format, ...)
|
#define BLT_TRACE(format, ...)
|
||||||
#define BLT_TRACE0_STREAM blt::logging::empty_logger{}
|
#define BLT_TRACE0_STREAM blt::logging::empty_logger{}
|
||||||
#define BLT_TRACE1_STREAM blt::logging::empty_logger{}
|
#define BLT_TRACE1_STREAM blt::logging::empty_logger{}
|
||||||
|
@ -642,7 +643,7 @@ namespace blt::logging {
|
||||||
#define BLT_TRACE_STREAM BLT_LOG_STREAM(blt::logging::log_level::TRACE)
|
#define BLT_TRACE_STREAM BLT_LOG_STREAM(blt::logging::log_level::TRACE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLT_ENABLE_DEBUG
|
#ifdef BLT_DISABLE_DEBUG
|
||||||
#define BLT_DEBUG(format, ...)
|
#define BLT_DEBUG(format, ...)
|
||||||
#define BLT_DEBUG_STREAM blt::logging::empty_logger{}
|
#define BLT_DEBUG_STREAM blt::logging::empty_logger{}
|
||||||
#else
|
#else
|
||||||
|
@ -650,7 +651,7 @@ namespace blt::logging {
|
||||||
#define BLT_DEBUG_STREAM BLT_LOG_STREAM(blt::logging::log_level::DEBUG)
|
#define BLT_DEBUG_STREAM BLT_LOG_STREAM(blt::logging::log_level::DEBUG)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLT_ENABLE_INFO
|
#ifdef BLT_DISABLE_INFO
|
||||||
#define BLT_INFO(format, ...)
|
#define BLT_INFO(format, ...)
|
||||||
#define BLT_INFO_STREAM blt::logging::empty_logger{}
|
#define BLT_INFO_STREAM blt::logging::empty_logger{}
|
||||||
#else
|
#else
|
||||||
|
@ -658,7 +659,7 @@ namespace blt::logging {
|
||||||
#define BLT_INFO_STREAM BLT_LOG_STREAM(blt::logging::log_level::INFO)
|
#define BLT_INFO_STREAM BLT_LOG_STREAM(blt::logging::log_level::INFO)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLT_ENABLE_WARN
|
#ifdef BLT_DISABLE_WARN
|
||||||
#define BLT_WARN(format, ...)
|
#define BLT_WARN(format, ...)
|
||||||
#define BLT_WARN_STREAM blt::logging::empty_logger{}
|
#define BLT_WARN_STREAM blt::logging::empty_logger{}
|
||||||
#else
|
#else
|
||||||
|
@ -666,7 +667,7 @@ namespace blt::logging {
|
||||||
#define BLT_WARN_STREAM BLT_LOG_STREAM(blt::logging::log_level::WARN)
|
#define BLT_WARN_STREAM BLT_LOG_STREAM(blt::logging::log_level::WARN)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLT_ENABLE_ERROR
|
#ifdef BLT_DISABLE_ERROR
|
||||||
#define BLT_ERROR(format, ...)
|
#define BLT_ERROR(format, ...)
|
||||||
#define BLT_ERROR_STREAM blt::logging::empty_logger{}
|
#define BLT_ERROR_STREAM blt::logging::empty_logger{}
|
||||||
#else
|
#else
|
||||||
|
@ -674,7 +675,7 @@ namespace blt::logging {
|
||||||
#define BLT_ERROR_STREAM BLT_LOG_STREAM(blt::logging::log_level::ERROR)
|
#define BLT_ERROR_STREAM BLT_LOG_STREAM(blt::logging::log_level::ERROR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BLT_ENABLE_FATAL
|
#ifdef BLT_DISABLE_FATAL
|
||||||
#define BLT_FATAL(format, ...)
|
#define BLT_FATAL(format, ...)
|
||||||
#define BLT_FATAL_STREAM blt::logging::empty_logger{}
|
#define BLT_FATAL_STREAM blt::logging::empty_logger{}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue