Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shreyasnayak/qtlogger
simple logger for qt c++ application
https://github.com/shreyasnayak/qtlogger
Last synced: about 1 month ago
JSON representation
simple logger for qt c++ application
- Host: GitHub
- URL: https://github.com/shreyasnayak/qtlogger
- Owner: shreyasnayak
- License: mit
- Created: 2022-01-02T17:46:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-21T13:12:19.000Z (over 2 years ago)
- Last Synced: 2023-07-13T07:22:45.234Z (over 1 year ago)
- Language: C++
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QtLogger
Simple logger for Qt C++ application
# How to build (Linux)
`qmake //QtLogger/QtLogger.pro`
`make`
`sudo make install`
# How to use in Qt Project
## Include library in Qt Project
```
unix:{
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib -lQtLogger
}
```## Example Code
```
#include
#include
#includeint main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);Logger *logger = Logger::GetInstance("App-Prefix");
logger->setLogLevel(Logger::Info);
logger->deleteLogFiles(15); // Delete log file older than 15 days
logger->logMessage(Logger::Info,__FILE__,"Application is started sucessfully");
std::cout << "File Path : " << logger->getLogFilePath().toStdString() << std::endl;
return a.exec();
}```