diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-03-05 21:08:01 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-03-05 21:08:01 +0000 |
commit | 0e8c7ebc65e2f5f59149fcd3ce63de4675d7c3d2 (patch) | |
tree | b0eed51495dafa67b5c82697b16904ee28c5012a /pjlib/include/pj/log.h | |
parent | 837c92b0337f44eac5469411a454e3188dbe2574 (diff) |
Optimization on the log and add tracing on mutex trylock
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1042 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/log.h')
-rw-r--r-- | pjlib/include/pj/log.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pjlib/include/pj/log.h b/pjlib/include/pj/log.h index c6622590..4d28abec 100644 --- a/pjlib/include/pj/log.h +++ b/pjlib/include/pj/log.h @@ -98,7 +98,10 @@ enum pj_log_decoration \endverbatim * @hideinitializer */ -#define PJ_LOG(level,arg) pj_log_wrapper_##level(arg) +#define PJ_LOG(level,arg) do { \ + if (level <= pj_log_get_level()) \ + pj_log_wrapper_##level(arg); \ + } while (0) /** * Signature for function to be registered to the logging subsystem to @@ -171,7 +174,12 @@ PJ_DECL(void) pj_log_set_level(int level); * * @return Current log maximum level. */ +#if 0 PJ_DECL(int) pj_log_get_level(void); +#else +PJ_DECL(int) pj_log_max_level; +#define pj_log_get_level() pj_log_max_level +#endif /** * Set log decoration. The log decoration flag controls what are printed |