cppSimpleLogger/MainExample.cpp

42 lines
1.0 KiB
C++
Raw Normal View History

2020-09-04 23:57:32 +02:00
/**
* @file MainExample.cpp
* @brief example using logger
* @author hendrik schutter
* @date 04.09.2020
*/
2018-10-16 23:34:45 +02:00
#include <stdio.h>
#include "logger.h"
using namespace std;
2020-09-04 23:57:32 +02:00
/**
* \brief application entry point
* \param void
* \return int
*/
2018-10-16 23:34:45 +02:00
int main(void)
{
cout << "Hello World!\n";
2018-10-17 17:03:07 +02:00
struct sID id;
2020-09-04 23:57:32 +02:00
id.description = "Software-Name - Copyright Company 2020"; //use your values here
id.deviceID = "Device-Name"; //use your values here
id.softwareID = "0.1.1.8"; //use your values here
id.hardwareID = "7.77.9"; //use your values here
2018-10-16 23:34:45 +02:00
2020-09-04 23:57:32 +02:00
Logger* logging = new Logger("./test.txt", id); //use your path here
2018-10-16 23:34:45 +02:00
2020-09-04 23:57:32 +02:00
logging->info("Alle Systeme laufen!"); //demo
usleep(1465);
logging->warning("Alle Systeme laufen!"); //demo
usleep(51654);
logging->error("Alle Systeme laufen!"); //demo
2018-10-16 23:34:45 +02:00
cout << "bye!\n";
return 0;
}