1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef VERBOSE_H
#define VERBOSE_H

#include <stdarg.h>
#include <stdio.h>

#define NOVERBOSE    -1
#define NORMAL       1
#define DEBUGVERBOSE 2
#define FULLVERBOSE  3
#define TOTALVERBOSE 4


// Terminal color
#define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"


namespace Glucose {
class Verbose {
   public:
    int verbosity;
    explicit Verbose(int v = NORMAL) : verbosity(v) { }

    void log(int vb, const char* format, ...) const {
        if(vb > verbosity) return;
        va_list argptr;
        va_start(argptr, format);
        vfprintf(stdout, format, argptr);
        va_end(argptr);
    }
};
};   // namespace Glucose

#endif /* VERBOSE_H */