/* * Copyright 2017-2022, Andrew Lindesay . * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef LOGGER_H #define LOGGER_H #include #include #include #include #include #include #define MILLIS_IN_DAY 86400000L #define HDLOGLEVELCHAR(L) ( \ L == LOG_LEVEL_INFO ? 'I' \ : L == LOG_LEVEL_DEBUG ? 'D' \ : L == LOG_LEVEL_TRACE ? 'T' \ : L == LOG_LEVEL_ERROR ? 'E' \ : '?') // These macros allow for standardized logging to be output. // The use of macros in this way means that the use of the log is concise where // it is used and also because the macro unwraps to a block contained with a // condition statement, if the log level is not sufficient to trigger the log // line then there is no computational cost to running over the log space. This // is because the arguments will not be evaluated. Avoiding all of the // conditional clauses in the code to prevent this otherwise would be // cumbersome. // The time element @