Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## Unreleased

## [0.29.1] 2025-11-03

### Bug fixes

* `Record::target_static` should return `&'static str` instead of `&str`.

## [0.29.0] 2025-11-03

### Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ logforth-append-async = { version = "0.3.0", path = "appenders/async" }
logforth-append-fastrace = { version = "0.3.0", path = "appenders/fastrace" }
logforth-append-file = { version = "0.3.0", path = "appenders/file" }
logforth-append-journald = { version = "0.3.0", path = "appenders/journald" }
logforth-append-opentelemetry = { version = "0.3.0", path = "appenders/opentelemetry" }
logforth-append-opentelemetry = { version = "0.3.1", path = "appenders/opentelemetry" }
logforth-append-syslog = { version = "0.3.0", path = "appenders/syslog" }
logforth-bridge-log = { version = "0.3.0", path = "bridges/log" }
logforth-core = { version = "0.3.0", path = "core" }
logforth-core = { version = "0.3.1", path = "core" }
logforth-diagnostic-fastrace = { version = "0.3.0", path = "diagnostics/fastrace" }
logforth-diagnostic-task-local = { version = "0.3.0", path = "diagnostics/task-local" }
logforth-layout-google-cloud-logging = { version = "0.3.0", path = "layouts/google-cloud-logging" }
Expand Down
2 changes: 1 addition & 1 deletion appenders/opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[package]
name = "logforth-append-opentelemetry"
version = "0.3.0"
version = "0.3.1"

description = "Opemtelemetry appender for Logforth."
keywords = ["logging", "log", "opentelemtry"]
Expand Down
11 changes: 10 additions & 1 deletion appenders/opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@ impl Append for OpentelemetryLog {
log_record.set_observed_timestamp(now);
log_record.set_severity_number(log_level_to_otel_severity(record.level()));
log_record.set_severity_text(record.level().name());
log_record.set_target(record.target().to_owned());

if let Some(target) = record.target_static() {
log_record.set_target(target);
} else {
log_record.set_target(record.target().to_owned());
}

if let Some(make_body) = self.make_body.as_ref() {
log_record.set_body(make_body.create(record, diags)?);
Expand All @@ -258,6 +263,10 @@ impl Append for OpentelemetryLog {
log_record.add_attribute("line", line);
}

if let Some(column) = record.column() {
log_record.add_attribute("column", column);
}

let mut extractor = KvExtractor {
record: &mut log_record,
};
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[package]
name = "logforth-core"
version = "0.3.0"
version = "0.3.1"

description = "Core structs and functions for Logforth."
keywords = ["logging", "log"]
Expand Down
2 changes: 1 addition & 1 deletion core/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl<'a> Record<'a> {
/// The name of the target of the directive, if it is a `'static` str.
///
/// This is typically the same as the module path, but can be set explicitly.
pub fn target_static(&self) -> Option<&'a str> {
pub fn target_static(&self) -> Option<&'static str> {
self.target.get_static()
}

Expand Down
2 changes: 1 addition & 1 deletion logforth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[package]
name = "logforth"
version = "0.29.0"
version = "0.29.1"

description = "A versatile and extensible logging implementation."
keywords = ["logging", "log", "opentelemetry", "fastrace"]
Expand Down