X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Flog.h;h=c4931e573b15d7479c9669ba1ba7b1f03f591340;hb=64d52e239f715717646357783d01ff8650dbdb2d;hp=16d328285ed1626108497fc10b54f0a504b05198;hpb=4d1a39be05a99a8fbd2b4839f37c7a21d4214c59;p=ptask.git diff --git a/src/log.h b/src/log.h index 16d3282..c4931e5 100644 --- a/src/log.h +++ b/src/log.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 jeanfi@gmail.com + * Copyright (C) 2010-2016 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -27,6 +27,7 @@ enum log_level { }; void log_open(const char *path); +void log_close(); void log_printf(int lvl, const char *fmt, ...); void log_debug(const char *fmt, ...); @@ -34,7 +35,11 @@ void log_err(const char *fmt, ...); void log_info(const char *fmt, ...); void log_warn(const char *fmt, ...); -void log_close(); +void _log(const char *fct, const char *fmt, ...); + +#define log_fct(...) _log(__func__, __VA_ARGS__) +#define log_fct_enter() log_fct("ENTER") +#define log_fct_exit() log_fct("EXIT") /* level of the log file. */ extern int log_level;