#include <AsyncFw/Version>
#include <AsyncFw/MainThread>
#include <AsyncFw/Log>
int main(int argc, char *argv[]) {
logThread.invokeMethod([]() { AsyncFw::Instance<AsyncFw::Log>::create(1000, "log-file-name"); }, true);
AsyncFw::Log::instance()->setColorOut(true);
logNotice() << "Version:" << AsyncFw::Version::str();
logNotice() << "Git:" << AsyncFw::Version::git();
lsTrace() << "Trace";
lsDebug() << "Debug";
lsInfo() << "Info";
lsInfoRed() << "Info red";
lsInfoGreen() << "Info green";
lsInfoBlue() << "Info blue";
lsInfoMagenta() << "Info magenta";
lsInfoCyan() << "Info cyan";
lsNotice() << "Notice";
lsWarning() << "Warning";
lsError() << "Error";
logTrace() << "Trace";
logDebug() << "Debug";
logInfo() << "Info";
logNotice() << "Notice";
logWarning() << "Warning";
logError() << "Error";
logAlert() << "logAlert";
int ret = AsyncFw::MainThread::exec();
AsyncFw::Log::instance()->append({AsyncFw::LogStream::Info, "Log", "Application finished", ""});
return ret;
}
std::enable_if< std::is_void< typenamestd::invoke_result< M >::type >::value, bool >::type invokeMethod(M method, bool sync=false) const
Runs a method in a managed thread.
Definition AbstractThread.h:79
void start()
Create a managed thread and run exec().
Definition AbstractThread.cpp:642
AsyncFw::Thread thread with sockets.
Definition Thread.h:16
static Thread * currentThread()
Returns a pointer to the AsyncFw::Thread that manages the currently executing thread.
Definition Thread.cpp:32