2018-06-19 02:37:19 +00:00
|
|
|
//
|
|
|
|
// Log.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 18/06/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Log_h
|
|
|
|
#define Log_h
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
|
2018-10-23 02:37:11 +00:00
|
|
|
#define LOG(x) while(false) {}
|
|
|
|
#define LOGNBR(x) while(false) {}
|
2018-06-21 23:27:54 +00:00
|
|
|
|
2018-10-23 02:37:11 +00:00
|
|
|
#define ERROR(x) while(false) {}
|
|
|
|
#define ERRORNBR(x) while(false) {}
|
2018-06-19 02:37:19 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include <iostream>
|
2018-06-21 03:02:32 +00:00
|
|
|
#include <ios>
|
2019-03-02 23:07:05 +00:00
|
|
|
#include <iomanip>
|
2018-06-19 02:37:19 +00:00
|
|
|
|
2019-04-15 16:41:56 +00:00
|
|
|
#define PADHEX(n) std::hex << std::setfill('0') << std::setw(n)
|
|
|
|
#define PADDEC(n) std::dec << std::setfill('0') << std::setw(n)
|
2018-06-21 23:27:54 +00:00
|
|
|
|
2019-10-11 02:45:03 +00:00
|
|
|
#ifdef LOG_PREFIX
|
|
|
|
|
|
|
|
#define LOG(x) std::cout << LOG_PREFIX << x << std::endl
|
|
|
|
#define LOGNBR(x) std::cout << LOG_PREFIX << x
|
|
|
|
|
|
|
|
#define ERROR(x) std::cerr << LOG_PREFIX << x << std::endl
|
|
|
|
#define ERRORNBR(x) std::cerr << LOG_PREFIX << x
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2018-06-19 02:37:19 +00:00
|
|
|
#define LOG(x) std::cout << x << std::endl
|
|
|
|
#define LOGNBR(x) std::cout << x
|
2018-06-21 23:27:54 +00:00
|
|
|
|
2018-06-19 02:37:19 +00:00
|
|
|
#define ERROR(x) std::cerr << x << std::endl
|
|
|
|
#define ERRORNBR(x) std::cerr << x
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-10-11 02:45:03 +00:00
|
|
|
#endif
|
|
|
|
|
2018-06-19 02:37:19 +00:00
|
|
|
|
|
|
|
#endif /* Log_h */
|