mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 17:24:26 +00:00
lib: add accessor for raw timestamp in zlog
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
ce2e1a7418
commit
df45017f48
@ -908,6 +908,11 @@ size_t zlog_msg_ts_3164(struct zlog_msg *msg, struct fbuf *out, uint32_t flags)
|
||||
return bputs(out, msg->ts_3164_str);
|
||||
}
|
||||
|
||||
void zlog_msg_tsraw(struct zlog_msg *msg, struct timespec *ts)
|
||||
{
|
||||
memcpy(ts, &msg->ts, sizeof(*ts));
|
||||
}
|
||||
|
||||
void zlog_set_prefix_ec(bool enable)
|
||||
{
|
||||
atomic_store_explicit(&zlog_ec, enable, memory_order_relaxed);
|
||||
|
@ -183,8 +183,11 @@ extern void zlog_msg_args(struct zlog_msg *msg, size_t *hdrlen,
|
||||
/* default is local time zone */
|
||||
#define ZLOG_TS_UTC (1 << 10)
|
||||
|
||||
struct timespec;
|
||||
|
||||
extern size_t zlog_msg_ts(struct zlog_msg *msg, struct fbuf *out,
|
||||
uint32_t flags);
|
||||
extern void zlog_msg_tsraw(struct zlog_msg *msg, struct timespec *ts);
|
||||
|
||||
/* "mmm dd hh:mm:ss" for RFC3164 syslog. Only ZLOG_TS_UTC for flags. */
|
||||
extern size_t zlog_msg_ts_3164(struct zlog_msg *msg, struct fbuf *out,
|
||||
|
Loading…
Reference in New Issue
Block a user