Skip to content
Open
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: 5 additions & 1 deletion lib/codecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ name = "generate-avro-fixtures"
path = "tests/bin/generate-avro-fixtures.rs"

[dependencies]
akin = { version = "0.4", optional = true }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to know if there's any policies about the additional crate deps I've added to support the PR. They're all marked optional and assigned to the syslog feature.

I could minimize the deps but it'd make the feature code itself less maintainer friendly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally if it is needed and the license is ok then we are fine to pull it in like you have done here.

However, I don't really see that this crate is adding enough to warrant it's inclusion. It's only used in one place from what I can see. There it would be more idiomatic to just use a simple macro:

macro_rules! deserialize_impl {
    ($enum:ty) => {
	impl $enum {
	    fn deserialize<'de, D>(deserializer: D) -> Result<Self, D::Error>
	
...

}

deserialize_impl!(Facility);
deserialize_impl!(Severity);

apache-avro = { version = "0.16.0", default-features = false }
bytes = { version = "1", default-features = false }
chrono.workspace = true
csv-core = { version = "0.1.10", default-features = false }
derivative = { version = "2", default-features = false }
derive_more = { version = "0.99", optional = true }
dyn-clone = { version = "1", default-features = false }
lookup = { package = "vector-lookup", path = "../vector-lookup", default-features = false, features = ["test"] }
memchr = { version = "2", default-features = false }
Expand All @@ -24,9 +26,11 @@ prost = { version = "0.12.3", default-features = false, features = ["std"] }
prost-reflect = { version = "0.13", default-features = false, features = ["serde"] }
regex = { version = "1.10.3", default-features = false, features = ["std", "perf"] }
serde.workspace = true
serde-aux = { version = "4.5", optional = true }
serde_json.workspace = true
smallvec = { version = "1", default-features = false, features = ["union"] }
snafu = { version = "0.7.5", default-features = false, features = ["futures"] }
strum = { version = "0.26", features = ["derive"], optional = true }
syslog_loose = { version = "0.21", default-features = false, optional = true }
tokio-util = { version = "0.7", default-features = false, features = ["codec"] }
tracing = { version = "0.1", default-features = false }
Expand All @@ -48,4 +52,4 @@ rstest = "0.18.2"
vrl.workspace = true

[features]
syslog = ["dep:syslog_loose"]
syslog = ["dep:syslog_loose", "dep:strum", "dep:akin", "dep:derive_more", "dep:serde-aux"]
2 changes: 2 additions & 0 deletions lib/codecs/src/encoding/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod native_json;
mod protobuf;
mod raw_message;
mod text;
mod syslog;

use std::fmt::Debug;

Expand All @@ -28,6 +29,7 @@ pub use native_json::{NativeJsonSerializer, NativeJsonSerializerConfig};
pub use protobuf::{ProtobufSerializer, ProtobufSerializerConfig, ProtobufSerializerOptions};
pub use raw_message::{RawMessageSerializer, RawMessageSerializerConfig};
pub use text::{TextSerializer, TextSerializerConfig};
pub use syslog::{SyslogSerializer, SyslogSerializerConfig};
use vector_core::event::Event;

/// Serialize a structured event into a byte frame.
Expand Down
Loading
Loading