61 lines
739 B
C++
61 lines
739 B
C++
#include <time.h>
|
|
#include <string.h>
|
|
#include <iostream>
|
|
#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;
|
|
} ;
|
|
|
|
|
|
class Logger {
|
|
|
|
|
|
private:
|
|
|
|
string logPath;
|
|
|
|
string getTimestamp();
|
|
void writeLog(string s);
|
|
string getMacAddress();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
Logger(string pLogPath, struct sID id);
|
|
~Logger();
|
|
void info(string s);
|
|
void warning(string s);
|
|
void error(string s);
|
|
|
|
void newLine();
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|