#include <iostream>
#include <string_view>
switch (level) {
return "trace";
return "debug";
return "info";
return "warning";
return "error";
return "fatal";
default:
return "unknown";
}
}
switch (category) {
return "network";
return "channel";
return "session";
return "server";
return "client";
return "userland";
return "securitypolicy";
default:
return "unknown";
}
}
int main() {
auto logger = [](
auto level,
auto category,
auto msg) {
std::cout << "[" << getLogLevelName(level) << "] "
<<
"[" << getLogCategoryName(category) <<
"] " <<
msg << std::endl;
};
server.config().setLogger(logger);
server.run();
}
void setLogger(LogFunction func)
static UA_LogCategory category
static UA_LogCategory const char * msg