25 void begin(Stream &out, FTPLogLevel level = LOG_ERROR) {
30 void setLogLevel(FTPLogLevel level) { min_log_level = level; }
32 FTPLogLevel getLogLevel() {
return min_log_level; }
34 void setOutput(Stream &out) { out_ptr = &out; }
36 void writeLog(FTPLogLevel level,
const char *module,
37 const char *msg =
nullptr) {
38 if (out_ptr !=
nullptr && level >= min_log_level) {
39 out_ptr->print(
"FTP ");
42 out_ptr->print(
"DEBUG - ");
45 out_ptr->print(
"INFO - ");
48 out_ptr->print(
"WARN - ");
51 out_ptr->print(
"ERROR - ");
54 out_ptr->print(module);
64 FTPLogLevel min_log_level = LOG_ERROR;
65 Stream *out_ptr =
nullptr;
67 FTPLoggerClass() =
default;
FTPLoggerClass To activate logging start the FTPLogger object with the output stream and (optionally)...
Definition FTPLogger.h:13
void begin(Stream &out, FTPLogLevel level=LOG_ERROR)
Starts the logging to the indicated output.
Definition FTPLogger.h:25
static FTPLoggerClass & instance()
Provides the single instance which is available as FTPLogger.
Definition FTPLogger.h:16
FTP client and server functionality.
Definition FTPBasicAPI.h:7