summaryrefslogtreecommitdiff
path: root/src/cflogprinter.c
blob: f99560971a6c234d225b332a8640b93421f3bd32 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <cflogprinter.h>

void cflp_success(char *msg, ...) {
    printf("%s[+] ", GREEN);

    va_list arg;

    va_start (arg, msg);
    vfprintf (stdout, msg, arg);
    va_end (arg);

    printf("%s\n", RESET);

}

void cflp_error(char *msg, ...) {
    printf("%s[-] ", RED);

    va_list arg;

    va_start (arg, msg);
    vfprintf (stderr, msg, arg); //print to stderr instead of stdout!
    va_end (arg);

    printf("%s\n", RESET);

}

void cflp_warning(char *msg, ...) {
    printf("%s[!] ", YELLOW);

    va_list arg;

    va_start (arg, msg);
    vfprintf (stdout, msg, arg);
    va_end (arg);

    printf("%s\n", RESET);

}

void cflp_info(char *msg, ...) {
    printf("[*] ");

    va_list arg;

    va_start (arg, msg);
    vfprintf (stdout, msg, arg);
    va_end (arg);

    printf("%s\n", RESET);

}

void cflp_custom(char *color, char *msg, ...) {
    printf("%s", color);

    va_list arg;

    va_start (arg, msg);
    vfprintf (stdout, msg, arg);
    va_end (arg);

    printf("%s\n", RESET);

}