pingap_logger/
lib.rs

1// Copyright 2024-2025 Tree xie.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use snafu::Snafu;
16
17mod access;
18#[cfg(unix)]
19mod syslog;
20mod writer;
21
22const LOG_CATEGORY: &str = "logger";
23
24#[derive(Debug, Snafu)]
25pub enum Error {
26    #[snafu(display("IO error {source}"))]
27    Io { source: std::io::Error },
28    #[snafu(display("Invalid {message}"))]
29    Invalid { message: String },
30}
31
32pub use access::*;
33pub use writer::*;