You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

38 lines
823 B

/*
* LogCommand.h
*
* Created on: Jul 8, 2021
* Author: Andreas Berthoud
*/
#ifndef LOGCOMMAND_H_
#define LOGCOMMAND_H_
#include "Command.hpp"
extern "C" void log_debug(const char * format, int nargs, ...);
extern "C" void log_info(const char * format, int nargs, ...);
extern "C" void log_warning(const char * format, int nargs, ...);
extern "C" void log_error(const char * format, int nargs, ...);
typedef enum : uint8_t{
LOG_LEVEL_DEBUG = 10,
LOG_LEVEL_INFO = 20,
LOG_LEVEL_WARNING = 30,
LOG_LEVEL_ERROR = 40,
} LoggingLevel;
class LogCommand : public Command {
public:
/*
* Create log command from formatted string
*/
LogCommand(const char * format, va_list args, LoggingLevel logging_level);
virtual ~LogCommand() {};
bool execute() override;
};
#endif /* LOGCOMMAND_H_ */