From: Jonathan Rajotte Julien Date: Wed, 25 Jun 2014 17:34:12 +0000 (-0400) Subject: Fix mi: add support for Jul loglevel X-Git-Tag: v2.6.0-rc1~115 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=136f2f81ca23f95585af57b773d7bc4e04407cda;p=lttng-tools.git Fix mi: add support for Jul loglevel Signed-off-by: Jonathan Rajotte Julien --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 2dd0dc8a3..210c2f437 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -184,34 +184,6 @@ const char *exclusion_string(int value) } } -static const char *loglevel_jul_string(int value) -{ - switch (value) { - case -1: - return ""; - case LTTNG_LOGLEVEL_JUL_OFF: - return "JUL_OFF"; - case LTTNG_LOGLEVEL_JUL_SEVERE: - return "JUL_SEVERE"; - case LTTNG_LOGLEVEL_JUL_WARNING: - return "JUL_WARNING"; - case LTTNG_LOGLEVEL_JUL_INFO: - return "JUL_INFO"; - case LTTNG_LOGLEVEL_JUL_CONFIG: - return "JUL_CONFIG"; - case LTTNG_LOGLEVEL_JUL_FINE: - return "JUL_FINE"; - case LTTNG_LOGLEVEL_JUL_FINER: - return "JUL_FINER"; - case LTTNG_LOGLEVEL_JUL_FINEST: - return "JUL_FINEST"; - case LTTNG_LOGLEVEL_JUL_ALL: - return "JUL_ALL"; - default: - return "<>"; - } -} - static const char *logleveltype_string(enum lttng_loglevel_type value) { switch (value) { @@ -913,7 +885,7 @@ static int list_session_jul_events(void) MSG("%s- %s%s (loglevel%s %s)", indent4, events[i].name, enabled_string(events[i].enabled), logleveltype_string(events[i].loglevel_type), - loglevel_jul_string(events[i].loglevel)); + mi_lttng_loglevel_string(events[i].loglevel)); } MSG(""); diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c index cd5c082fd..9c98a0dd7 100644 --- a/src/common/mi-lttng.c +++ b/src/common/mi-lttng.c @@ -114,6 +114,17 @@ const char * const mi_lttng_loglevel_str_notice = "TRACE_NOTICE"; const char * const mi_lttng_loglevel_str_unknown = "UNKNOWN"; const char * const mi_lttng_loglevel_str_warning = "TRACE_WARNING"; +/* String related to loglevel JUL */ +const char * const mi_lttng_loglevel_str_jul_all = "JUL_ALL"; +const char * const mi_lttng_loglevel_str_jul_config = "JUL_CONFIG"; +const char * const mi_lttng_loglevel_str_jul_fine = "JUL_FINE"; +const char * const mi_lttng_loglevel_str_jul_finer = "JUL_FINER"; +const char * const mi_lttng_loglevel_str_jul_finest = "JUL_FINEST"; +const char * const mi_lttng_loglevel_str_jul_info = "JUL_INFO"; +const char * const mi_lttng_loglevel_str_jul_off = "JUL_OFF"; +const char * const mi_lttng_loglevel_str_jul_severe = "JUL_SEVERE"; +const char * const mi_lttng_loglevel_str_jul_warning = "JUL_WARNING"; + /* String related to loglevel type */ const char * const mi_lttng_loglevel_type_all = "ALL"; const char * const mi_lttng_loglevel_type_range = "RANGE"; @@ -132,6 +143,10 @@ const char * const mi_lttng_element_snapshot_n_ptr = "n_ptr"; const char * const mi_lttng_element_snapshot_session_name = "session_name"; const char * const mi_lttng_element_snapshots = "snapshots"; +/* This is a merge of jul loglevel and regular loglevel + * Those should never overlap by definition + * (see struct lttng_event loglevel) + */ const char *mi_lttng_loglevel_string(int value) { switch (value) { @@ -167,6 +182,24 @@ const char *mi_lttng_loglevel_string(int value) return mi_lttng_loglevel_str_debug_line; case LTTNG_LOGLEVEL_DEBUG: return mi_lttng_loglevel_str_debug; + case LTTNG_LOGLEVEL_JUL_OFF: + return mi_lttng_loglevel_str_jul_off; + case LTTNG_LOGLEVEL_JUL_SEVERE: + return mi_lttng_loglevel_str_jul_severe; + case LTTNG_LOGLEVEL_JUL_WARNING: + return mi_lttng_loglevel_str_jul_warning; + case LTTNG_LOGLEVEL_JUL_INFO: + return mi_lttng_loglevel_str_jul_info; + case LTTNG_LOGLEVEL_JUL_CONFIG: + return mi_lttng_loglevel_str_jul_config; + case LTTNG_LOGLEVEL_JUL_FINE: + return mi_lttng_loglevel_str_jul_fine; + case LTTNG_LOGLEVEL_JUL_FINER: + return mi_lttng_loglevel_str_jul_finer; + case LTTNG_LOGLEVEL_JUL_FINEST: + return mi_lttng_loglevel_str_jul_finest; + case LTTNG_LOGLEVEL_JUL_ALL: + return mi_lttng_loglevel_str_jul_all; default: return mi_lttng_loglevel_str_unknown; } diff --git a/src/common/mi-lttng.h b/src/common/mi-lttng.h index 476310ba4..e5ca54473 100644 --- a/src/common/mi-lttng.h +++ b/src/common/mi-lttng.h @@ -138,6 +138,17 @@ const char * const mi_lttng_loglevel_str_notice; const char * const mi_lttng_loglevel_str_unknown; const char * const mi_lttng_loglevel_str_warning; +/* String related to loglevel JUL */ +const char * const mi_lttng_loglevel_str_jul_all; +const char * const mi_lttng_loglevel_str_jul_config; +const char * const mi_lttng_loglevel_str_jul_fine; +const char * const mi_lttng_loglevel_str_jul_finer; +const char * const mi_lttng_loglevel_str_jul_finest; +const char * const mi_lttng_loglevel_str_jul_info; +const char * const mi_lttng_loglevel_str_jul_off; +const char * const mi_lttng_loglevel_str_jul_severe; +const char * const mi_lttng_loglevel_str_jul_warning; + /* String related to loglevel type */ const char * const mi_lttng_loglevel_type_all; const char * const mi_lttng_loglevel_type_range; @@ -148,7 +159,7 @@ const char * const mi_lttng_loglevel_type_unknown; const char * const mi_lttng_element_calibrate; const char * const mi_lttng_element_calibrate_function; -/* String related to a lttng_snashot */ +/* String related to a lttng_snapshot */ const char * const mi_lttng_element_snapshot_ctrl_url; const char * const mi_lttng_element_snapshot_data_url; const char * const mi_lttng_element_snapshot_max_size; @@ -324,7 +335,7 @@ int mi_lttng_sessions_open(struct mi_writer *writer); * is_open Defines whether or not the session element shall be closed. * This should be used carefully and the client * must close the session element. - * Use case: nested addtionnal information on a session + * Use case: nested additional information on a session * ex: domain,channel event. * * Returns zero if the element's value could be written. diff --git a/src/common/mi_lttng.xsd b/src/common/mi_lttng.xsd index 57960119e..c5bd1d935 100644 --- a/src/common/mi_lttng.xsd +++ b/src/common/mi_lttng.xsd @@ -123,6 +123,15 @@ THE SOFTWARE. + + + + + + + + +