// Copyright 2022 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34//! Facilities for sending log message to syslog.5//!6//! Every function exported by this module is thread-safe. Each function will silently fail until7//! `syslog::init()` is called and returns `Ok`.8//!9//! # Examples10//!11//! ```12//! use base::{error, self, warn};13//!14//! if let Err(e) = base::syslog::init() {15//! println!("failed to initiailize syslog: {}", e);16//! return;17//! }18//! warn!("this is your {} warning", "final");19//! error!("something went horribly wrong: {}", "out of RAMs");20//! ```2122use crate::syslog::Error;23use crate::syslog::Facility;24use crate::syslog::Log;25use crate::syslog::Syslog;26use crate::RawDescriptor;2728// SAFETY:29// On windows RawDescriptor is !Sync + !Send, but also on windows we don't do anything with them30unsafe impl Sync for crate::syslog::State {}31// SAFETY: See comments for impl Sync32unsafe impl Send for crate::syslog::State {}3334pub struct PlatformSyslog {}3536impl Syslog for PlatformSyslog {37fn new(38_proc_name: String,39_facility: Facility,40) -> Result<(Option<Box<dyn Log + Send>>, Option<RawDescriptor>), &'static Error> {41Ok((None, None))42}43}444546