11
* This is a cheap logger, do not use for production code,
12
* it is only for targets where GLib is not available.
14
* Use GLib's logging capabilities instead.
17
private const string STR_ERROR = "[ERROR]: ";
18
private const string STR_INFO = "[INFO]: ";
19
private unowned FILE out_file;
21
private static Logger logger = null;
23
public Logger (FILE out_file) {
24
this.out_file = out_file;
27
public static Logger get_default () {
29
Logger.logger = new Logger (Posix.stdout);
34
public static void set_default (Logger logger) {
35
Logger.logger = logger;
38
public void error (string str, ...) {
39
out_file.printf (STR_ERROR);
40
out_file.printf (str, va_list());
43
public void info (string str, ...) {
44
out_file.printf (STR_INFO);
45
out_file.printf (str, va_list());
48
public static void free_default () {
49
Posix.free(Logger.logger);