From e5b869b3030710d9eb0bf83afa5dd95a042e44ca Mon Sep 17 00:00:00 2001 From: henry0715-dev Date: Mon, 28 Oct 2024 09:50:24 +0900 Subject: [PATCH] Added `source` field to `OpLog` Close #136 --- CHANGELOG.md | 6 ++++++ src/ingest/log.rs | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd331ea..d98325a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added `source` field to `OpLog`. + ## [0.20.0] - 2024-09-10 ### Changed diff --git a/src/ingest/log.rs b/src/ingest/log.rs index 2923f7e..dd2bdae 100644 --- a/src/ingest/log.rs +++ b/src/ingest/log.rs @@ -32,6 +32,7 @@ pub struct OpLog { pub agent_name: String, pub log_level: OpLogLevel, pub contents: String, + pub source: String, // Category, id } @@ -46,8 +47,8 @@ impl Display for OpLog { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { write!( f, - "{}\t{:?}\t{}", - self.agent_name, self.log_level, self.contents + "{}\t{:?}\t{}\t{}", + self.agent_name, self.log_level, self.contents, self.source ) } }