Browse Source

Include rack:: namespace in APP and logger macros (DEBUG, INFO, WARN, FATAL).

tags/v1.1.6
Andrew Belt 5 years ago
parent
commit
dbd117ea62
3 changed files with 8 additions and 5 deletions
  1. +1
    -1
      include/app.hpp
  2. +4
    -4
      include/logger.hpp
  3. +3
    -0
      include/rack.hpp

+ 1
- 1
include/app.hpp View File

@@ -49,7 +49,7 @@ void appDestroy();
App* appGet();

/** Accesses the global App pointer */
#define APP appGet()
#define APP rack::appGet()


} // namespace rack

+ 4
- 4
include/logger.hpp View File

@@ -9,10 +9,10 @@ will print something like

[0.123 debug myfile.cpp:45] error: 67
*/
#define DEBUG(format, ...) logger::log(rack::logger::DEBUG_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define INFO(format, ...) logger::log(rack::logger::INFO_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define WARN(format, ...) logger::log(rack::logger::WARN_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define FATAL(format, ...) logger::log(rack::logger::FATAL_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define DEBUG(format, ...) rack::logger::log(rack::logger::DEBUG_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define INFO(format, ...) rack::logger::log(rack::logger::INFO_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define WARN(format, ...) rack::logger::log(rack::logger::WARN_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)
#define FATAL(format, ...) rack::logger::log(rack::logger::FATAL_LEVEL, __FILE__, __LINE__, format, ##__VA_ARGS__)


namespace rack {


+ 3
- 0
include/rack.hpp View File

@@ -112,6 +112,9 @@ namespace rack {
using plugin::Model;
using namespace engine;
using namespace componentlibrary;

// Import namespace recursively to solve the problem of calling `rack::DEBUG(...)` which expands to `rack::rack::logger(...)`.
namespace rack = rack;
#endif




Loading…
Cancel
Save