|
|
- /*
- * Log.h
- *
- * Created on: 16.01.2017
- * Author: piotrek
- */
-
- #ifndef LOG_H_
- #define LOG_H_
-
- #include "common.h"
-
- enum LOG_COLOR {
- BLACK,
- RED,
- GREEN,
- YELLOW,
- BLUE,
- MAGENTA,
- CYAN,
- WHITE
- };
-
- class Log
- {
- int lineNumber;
- LOG_COLOR color;
- string delimiter;
- string *objectName;
- pthread_mutex_t *writeMutex;
- int delayVal;
-
- public:
- Log();
- void print(string msg, bool force=false);
- void printProgressBar(int lineNumber, int offset, string msg, float percent);
-
- LOG_COLOR getColor() const;
- void setColor(LOG_COLOR color);
- const string& getDelimiter() const;
- void setDelimiter(const string& delimiter);
- int getLineNumber() const;
- void setLineNumber(int lineNumber);
- void setLogParams(int lineNumber, LOG_COLOR color, string delimiter);
- static pthread_mutex_t * getMutex();
- void delay(int optional=-1);
- int getDelay() const;
- void setDelay(int delay);
- string* getObjectName() const;
- void setObjectName(string* objectName);
- };
-
- #endif /* LOG_H_ */
|