1 // Copyright 2022 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 //! Implementation of the Syslog trait as a wrapper around Window's events 6 7 use super::super::{ 8 syslog::{Error, Facility, Priority, Syslog}, 9 RawDescriptor, 10 }; 11 12 pub struct PlatformSyslog { 13 enabled: bool, 14 } 15 16 impl Syslog for PlatformSyslog { new() -> Result<Self, Error>17 fn new() -> Result<Self, Error> { 18 Ok(Self { enabled: true }) 19 } 20 enable(&mut self, enable: bool) -> Result<(), Error>21 fn enable(&mut self, enable: bool) -> Result<(), Error> { 22 self.enabled = enable; 23 Ok(()) 24 } 25 push_descriptors(&self, _fds: &mut Vec<RawDescriptor>)26 fn push_descriptors(&self, _fds: &mut Vec<RawDescriptor>) {} 27 log( &self, _proc_name: Option<&str>, _pri: Priority, _fac: Facility, _file_line: Option<(&str, u32)>, _args: std::fmt::Arguments, )28 fn log( 29 &self, 30 _proc_name: Option<&str>, 31 _pri: Priority, 32 _fac: Facility, 33 _file_line: Option<(&str, u32)>, 34 _args: std::fmt::Arguments, 35 ) { 36 // do nothing. We don't plan to support writing to windows system logs. 37 } 38 } 39