Digi XBeeLib fixed for NonCopyable issue
Dependents: XBeeZB_Receive_Data
Fork of XBeeLib by
This lib fixes NonCopyable<T> issues of Digi XBeeLib. Also, lib has been reworked in order to make it RTOS-aware, overcoming several others issues due to stdio Mutex operations.
DigiLogger/DigiLogger.h
- Committer:
- Lorenzo Maiorfi
- Date:
- 2018-04-08
- Revision:
- 13:09e0b4f5a9e1
- Parent:
- 11:c49cf952d67d
File content as of revision 13:09e0b4f5a9e1:
/** * Copyright (c) 2015 Digi International Inc., * All rights not expressly granted are reserved. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 * ======================================================================= */ #if !defined(__DIGI_LOGGER_H_) #define __DIGI_LOGGER_H_ #include <cstdlib> #include <stdio.h> /** * @defgroup LogLevel * @{ */ /** * Library Logging level. */ enum LogLevel { LogLevelNone, /** Level None */ LogLevelError, /** Level Error */ LogLevelWarning, /** Level Warning */ LogLevelInfo, /** Level Info */ LogLevelDebug, /** Level Debug */ LogLevelFrameData, /** Level Frame Data */ LogLevelAll /** Level All */ }; /** * @} */ #define DEBUG_BUFFER_LEN 200 namespace DigiLog { class DigiLogger { protected: /** module log level */ static LogLevel _log_level; static DigiLogger* current_logger; /* Not implemented for base class */ virtual void log_buffer(char const * const buffer); public: /** Class constructor */ DigiLogger(); /** Class destructor */ virtual ~DigiLogger(); /** set_level - set logging level. * * @param log_level desired overall logging level */ static void set_level(LogLevel log_level); /** get_level - get logging level. * * @returns current overall logging level */ static LogLevel get_level(); /** log_format - logs a printf-like message. * * @param log_level logging level * @param format ... printf-like message */ static void log_format(LogLevel log_level, const char *format, ...); }; } /* namespace DigiLog */ #endif /* defined(__DIGI_LOGGER_H_) */