|
|
| Log (int=0, const std::string &={}) |
| |
|
void | finality () |
| |
| void | output (const Message &m) override |
| |
|
void | setAutoSave (bool b) |
| |
|
Rrd::Item | rrdItemFromMessage (const Message &m) const |
| |
|
Message | messageFromRrdItem (const Rrd::Item &_v) const |
| |
|
Message | readMessage (uint32_t index) |
| |
|
void | writeMessage (uint32_t index, const Message &message) |
| |
| void | save () override |
| |
|
void | append (uint8_t, const std::string &, const std::string &, const std::string &={}) |
| |
|
void | append (const Message &m) |
| |
|
template<typename T> |
| void | setAverage (int _interval, T f, int _offset=0) |
| |
|
| Rrd (int size, int interval, int fillInterval, const std::string &name) |
| |
|
| Rrd (int size, int interval, int fillInterval) |
| |
|
| Rrd (int size, const std::string &name) |
| |
|
| Rrd (int size) |
| |
|
uint64_t | read (DataArrayList *list, uint64_t from=0, uint32_t size=0, uint64_t *lastIndex=nullptr) |
| |
|
void | setFillInterval (int interval) |
| |
|
uint32_t | size () |
| |
|
uint32_t | count () |
| |
|
Item | readFromArray (uint32_t) |
| |
|
void | writeToArray (uint32_t, const Item &) |
| |
|
void | append (const Item &data, uint64_t index=0) |
| |
|
void | save (const std::string &fn={}) |
| |
|
void | clear () |
| |
|
uint64_t | lastIndex () |
| |
|
Thread * | thread () |
| |
|
void | append (uint8_t, const std::string &, const std::string &, const std::string &={}) |
| |
|
void | setExtendOut (bool b) |
| |
|
void | setColorOut (bool b) |
| |
|
void | setNotesOut (bool b) |
| |
|
void | setHideDuplicates (bool b) |
| |
|
void | setLevel (int i) |
| |
|
void | setConsoleLevel (int i) |
| |
|
void | setFilter (const std::vector< std::string > &f) |
| |
The Log class.
Example:
#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;
}