Skip to content

Commit

Permalink
feat: reexport BroadcastSender from fast/fasyslog#6
Browse files Browse the repository at this point in the history
  • Loading branch information
BBArikL committed Nov 14, 2024
1 parent 5453fd2 commit a98de8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ log = { version = "0.4", features = ["std", "kv_unstable"] }
# Optional dependencies
crossbeam-channel = { version = "0.5", optional = true }
fastrace = { version = "0.7", optional = true }
fasyslog = { version = "0.2", optional = true }
fasyslog = { git = "https://github.com/BBArikL/fasyslog.git", optional = true }
libc = { version = "0.2.162", optional = true }
opentelemetry = { version = "0.27", features = ["logs"], optional = true }
opentelemetry-otlp = { version = "0.27", features = [
Expand Down
14 changes: 14 additions & 0 deletions src/append/syslog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ impl SyslogWriter {
.map(Self::new)
}

/// Create a new syslog writer that broadcast messages to the well-known UDP port (514).
pub fn broadcast_well_known() -> io::Result<SyslogWriter> {
fasyslog::sender::broadcast_well_known()
.map(SyslogSender::Broadcast)
.map(Self::new)
}

/// Create a new syslog writer that broadcast messages to the given UDP address.
pub fn broadcast(port: u16) -> io::Result<SyslogWriter> {
fasyslog::sender::broadcast(port)
.map(SyslogSender::Broadcast)
.map(Self::new)
}

/// Create a new syslog writer that sends messages to the given Unix stream socket.
#[cfg(unix)]
pub fn unix_stream(path: impl AsRef<std::path::Path>) -> io::Result<SyslogWriter> {
Expand Down

0 comments on commit a98de8f

Please sign in to comment.