From f688b3cad508303ad9b7996d23b1be918a49194b Mon Sep 17 00:00:00 2001 From: ge Date: Sun, 11 Jan 2026 08:57:56 +0300 Subject: [PATCH] cleanup, use struct update syntax --- examples/unix_timestamp.v | 1 - structlog.v | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/unix_timestamp.v b/examples/unix_timestamp.v index 5a4fef2..a93f31e 100644 --- a/examples/unix_timestamp.v +++ b/examples/unix_timestamp.v @@ -4,7 +4,6 @@ import structlog fn main() { // Initialize logger with edited timestamp. log := structlog.new( - // timestamp_format: .unix timestamp: structlog.Timestamp{ format: .unix } diff --git a/structlog.v b/structlog.v index 12c28a9..283ba8c 100644 --- a/structlog.v +++ b/structlog.v @@ -96,9 +96,8 @@ pub fn (r Record) append(field ...Field) Record { mut fields_orig := unsafe { r.fields } fields_orig << field return Record{ - channel: r.channel - level: r.level - fields: &fields_orig + ...r + fields: &fields_orig } } @@ -110,9 +109,8 @@ pub fn (r Record) prepend(field ...Field) Record { mut new_fields := unsafe { field } new_fields << r.fields return Record{ - channel: r.channel - level: r.level - fields: new_fields + ...r + fields: new_fields } }