Skip to content

Commit e70143a

Browse files
authored
Make g_rcutils_log_severity_names public and immutable. (#180)
Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 6883279 commit e70143a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/rcutils/logging.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ enum RCUTILS_LOG_SEVERITY
172172
};
173173

174174
/// The names of severity levels.
175-
extern const char * g_rcutils_log_severity_names[RCUTILS_LOG_SEVERITY_FATAL + 1];
175+
RCUTILS_PUBLIC
176+
extern const char * const g_rcutils_log_severity_names[RCUTILS_LOG_SEVERITY_FATAL + 1];
176177

177178
/// Get a severity value from its string representation (e.g. DEBUG).
178179
/**

src/logging.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern "C"
4343

4444
#define RCUTILS_LOGGING_MAX_OUTPUT_FORMAT_LEN (2048)
4545

46-
const char * g_rcutils_log_severity_names[] = {
46+
const char * const g_rcutils_log_severity_names[] = {
4747
[RCUTILS_LOG_SEVERITY_UNSET] = "UNSET",
4848
[RCUTILS_LOG_SEVERITY_DEBUG] = "DEBUG",
4949
[RCUTILS_LOG_SEVERITY_INFO] = "INFO",

0 commit comments

Comments
 (0)