cppSimpleLogger/logger.h

61 lines
739 B
C
Raw Normal View History

2018-10-16 23:34:45 +02:00
#include <time.h>
#include <string.h>
#include <iostream>
2018-10-17 17:03:07 +02:00
#include <fstream>
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
using namespace std;
struct sID {
string description;
string deviceID;
string softwareID;
string hardwareID;
} ;
2018-10-16 23:34:45 +02:00
class Logger {
2018-10-17 17:03:07 +02:00
private:
string logPath;
string getTimestamp();
void writeLog(string s);
string getMacAddress();
2018-10-16 23:34:45 +02:00
public:
2018-10-17 17:03:07 +02:00
Logger(string pLogPath, struct sID id);
2018-10-16 23:34:45 +02:00
~Logger();
2018-10-17 17:03:07 +02:00
void info(string s);
void warning(string s);
void error(string s);
void newLine();
2018-10-16 23:34:45 +02:00
};