runtime_logger
最終更新
役に立ちましたか?
最終更新
役に立ちましたか?
役に立ちましたか?
// Logging with DEBUG_OUT
// The runtime will use DebugLoggerBackend if you specify DEBUG_OUT.
// On Windows, the log messages will be output to the Debug Output window.
// On other platforms, the log messages will be output to the console.
DiarkisUtils::Print("************************ Logging with DEBUG_OUT ****************************");
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
{
DiarkisInterface::DiarkisInit(uid, LogOutType::DEBUG_OUT);
if (RunDiarkis(host, uid, clientKey) != 0)
{
DiarkisInterface::DiarkisDestroy();
return 1;
}
DiarkisInterface::DiarkisDestroy();
}/**
* This is a sample implementation of the custom logger.
*/
class AppCustomLoggerBackend : public ILoggerBackend
{
public:
...Result Log(const Diarkis::StdString& message, bool includeNewLine) override
{
// Custom log output implementation
// A log message is passed into this method, so you can implement your app-specific log output here.
// This method could be called from multiple threads, so make sure your implementation is thread-safe.
DiarkisUtils::Print("Add log to the app logger: %s", message.c_str());
return Diarkis::Results::SUCCESS;
}