Skip to content

Commit 25e6b36

Browse files
committed
Replace private JournaldFormatter with PartialFormatter
1 parent 8bc177d commit 25e6b36

File tree

3 files changed

+14
-90
lines changed

3 files changed

+14
-90
lines changed

spdlog/src/formatter/journald_formatter.rs

Lines changed: 0 additions & 72 deletions
This file was deleted.

spdlog/src/formatter/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@
5757
))]
5858
mod android_formatter;
5959
mod full_formatter;
60-
#[cfg(any(
61-
all(target_os = "linux", feature = "native", feature = "libsystemd"),
62-
all(doc, not(doctest))
63-
))]
64-
mod journald_formatter;
6560
#[cfg(feature = "serde_json")]
6661
mod json_formatter;
6762
mod local_time_cacher;
@@ -78,11 +73,6 @@ use std::ops::Range;
7873
pub(crate) use android_formatter::*;
7974
use dyn_clone::*;
8075
pub use full_formatter::*;
81-
#[cfg(any(
82-
all(target_os = "linux", feature = "native", feature = "libsystemd"),
83-
all(doc, not(doctest))
84-
))]
85-
pub(crate) use journald_formatter::*;
8676
#[cfg(feature = "serde_json")]
8777
pub use json_formatter::*;
8878
pub(crate) use local_time_cacher::*;

spdlog/src/sink/journald_sink.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{io, os::raw::c_int};
22

33
use crate::{
4-
formatter::{Formatter, FormatterContext, JournaldFormatter},
4+
formatter::{Formatter, FormatterContext, PartialFormatter},
55
sink::{GetSinkProp, Sink, SinkProp},
66
sync::*,
77
Error, ErrorHandler, Level, LevelFilter, Record, Result, StdResult, StringBuf,
@@ -97,19 +97,24 @@ impl JournaldSink {
9797

9898
/// Gets a builder of `JournaldSink` with default parameters:
9999
///
100-
/// | Parameter | Default Value |
101-
/// |-----------------|-----------------------------|
102-
/// | [level_filter] | [`LevelFilter::All`] |
103-
/// | [formatter] | `JournaldFormatter` |
104-
/// | [error_handler] | [`ErrorHandler::default()`] |
100+
/// | Parameter | Default Value |
101+
/// |-----------------|-------------------------------------------------|
102+
/// | [level_filter] | [`LevelFilter::All`] |
103+
/// | [formatter] | [`PartialFormatter`] `(!time !source_location)` |
104+
/// | [error_handler] | [`ErrorHandler::default()`] |
105105
///
106106
/// [level_filter]: JournaldSinkBuilder::level_filter
107107
/// [formatter]: JournaldSinkBuilder::formatter
108108
/// [error_handler]: JournaldSinkBuilder::error_handler
109109
#[must_use]
110110
pub fn builder() -> JournaldSinkBuilder {
111111
let prop = SinkProp::default();
112-
prop.set_formatter(JournaldFormatter::new());
112+
prop.set_formatter(
113+
PartialFormatter::builder()
114+
.time(false)
115+
.source_location(false)
116+
.build(),
117+
);
113118

114119
JournaldSinkBuilder { prop }
115120
}
@@ -174,7 +179,8 @@ impl JournaldSinkBuilder {
174179

175180
/// Specifies a formatter.
176181
///
177-
/// This parameter is **optional**, and defaults to `JournaldFormatter`.
182+
/// This parameter is **optional**, and defaults to [`PartialFormatter`]
183+
/// `(!time !source_location)`.
178184
#[must_use]
179185
pub fn formatter<F>(self, formatter: F) -> Self
180186
where

0 commit comments

Comments
 (0)