Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32043 )
Change subject: logging: add 'logging timezone (localtime|utc)' ......................................................................
Patch Set 1:
(6 comments)
File include/osmocom/core/logging.h:
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/28d50396_f79e692c PS1, Line 400: /* Set timezone for logging of timestamps: 0 for local time, 1 for UTC. Other values are reserved for future 0 and 1? don't we have enums for that in this patch?
File src/core/logging.c:
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/8c03e462_e6ca75d7 PS1, Line 474: return 0; I'd really return an error if the requested timestamp cannot be obtained.
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/134537ea_2bd3e264 PS1, Line 528: } else if (target->print_timestamp && get_timestamp(&tv, &tm, target) == 0) { you are calling get_timestamp twice here every time we log something. You can move get_timestamp in front and call it once.
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/898e7f8d_7f1c16f1 PS1, Line 874: target->timezone = timezone; this should return an int and return an error if user wants to set a timezone for which we don't have support (#ifdef HAVE_LOCALTIME_R for instance).
File src/vty/logging_vty.c:
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/6997ed90_913e13c3 PS1, Line 203: log_set_timezone(tgt, LOG_TIMEZONE_UTC); in here, chewck the error code returned and if it failed return CMD_WARNING with a logging saying that this timezone is not supported in this system.
File tests/logging/logging_vty_test.vty:
https://gerrit.osmocom.org/c/libosmocore/+/32043/comment/e45dd7d9_932dc607 PS1, Line 75: logging_vty_test# logging timestamp ? you could add a "logging timezone ?" test here.