diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-07-19 17:53:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-07-19 17:53:47 +0000 |
commit | 2f89f6ad8e113cb108795d7ef2b6d81eb92c9a2a (patch) | |
tree | 6d99dd7ac0fc51a29039b25a0ccf009e7b3a4df3 /pjlib/include/pj/log.h | |
parent | 2a67327941910feadbfd953e4f8b53e675d5fe1a (diff) |
Ticket #571: Coloring for logs in Linux/UNIX, two more spaces in logs and runtime log colors configuration (thanks Ondrej.Sterbak)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2159 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/log.h')
-rw-r--r-- | pjlib/include/pj/log.h | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/pjlib/include/pj/log.h b/pjlib/include/pj/log.h index 76d609dd..2d0961c9 100644 --- a/pjlib/include/pj/log.h +++ b/pjlib/include/pj/log.h @@ -68,15 +68,17 @@ PJ_BEGIN_DECL */ enum pj_log_decoration { - PJ_LOG_HAS_DAY_NAME = 1, /**< Include day name [default: no]. */ - PJ_LOG_HAS_YEAR = 2, /**< Include year digit [default: no] */ - PJ_LOG_HAS_MONTH = 4, /**< Include month [default: no] */ - PJ_LOG_HAS_DAY_OF_MON = 8, /**< Include day of month [default: no] */ - PJ_LOG_HAS_TIME = 16, /**< Include time [default: yes]. */ - PJ_LOG_HAS_MICRO_SEC = 32, /**< Include microseconds [yes] */ - PJ_LOG_HAS_SENDER = 64, /**< Include sender in the log [yes]. */ - PJ_LOG_HAS_NEWLINE = 128, /**< Terminate each call with newline [yes].*/ - PJ_LOG_HAS_CR = 256 /**< Include carriage return [no]. */ + PJ_LOG_HAS_DAY_NAME = 1, /**< Include day name [default: no] */ + PJ_LOG_HAS_YEAR = 2, /**< Include year digit [no] */ + PJ_LOG_HAS_MONTH = 4, /**< Include month [no] */ + PJ_LOG_HAS_DAY_OF_MON = 8, /**< Include day of month [no] */ + PJ_LOG_HAS_TIME = 16, /**< Include time [yes] */ + PJ_LOG_HAS_MICRO_SEC = 32, /**< Include microseconds [yes] */ + PJ_LOG_HAS_SENDER = 64, /**< Include sender in the log [yes] */ + PJ_LOG_HAS_NEWLINE = 128, /**< Terminate each call with newline [yes] */ + PJ_LOG_HAS_CR = 256, /**< Include carriage return [no] */ + PJ_LOG_HAS_SPACE = 512, /**< Include two spaces before log [yes] */ + PJ_LOG_HAS_COLOR = 1024 /**< Colorize logs [yes on win32] */ }; /** @@ -199,6 +201,23 @@ PJ_DECL(void) pj_log_set_decor(unsigned decor); PJ_DECL(unsigned) pj_log_get_decor(void); +/** + * Set color of log messages. + * + * @param level Log level which color will be changed. + * @param color Desired color. + */ +PJ_DECL(void) pj_log_set_color(int level, pj_color_t color); + +/** + * Get color of log messages. + * + * @param level Log level which color will be returned. + * @return Log color. + */ +PJ_DECL(pj_color_t) pj_log_get_color(int level); + + #else /* #if PJ_LOG_MAX_LEVEL >= 1 */ /** @@ -236,6 +255,14 @@ PJ_DECL(unsigned) pj_log_get_decor(void); # define pj_log_set_decor(decor) /** + * Set color of log messages. + * + * @param level Log level which color will be changed. + * @param color Desired color. + */ +# define pj_log_set_color(level, color) + +/** * Get current maximum log verbositylevel. * * @return Current log maximum level. @@ -249,6 +276,14 @@ PJ_DECL(unsigned) pj_log_get_decor(void); */ # define pj_log_get_decor() 0 +/** + * Get color of log messages. + * + * @param level Log level which color will be returned. + * @return Log color. + */ +# define pj_log_get_color(level) 0 + #endif /* #if PJ_LOG_MAX_LEVEL >= 1 */ |