xref: /aosp_15_r20/external/pigweed/pw_log/rust/pw_log_backend_api.rs (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1 // Copyright 2023 The Pigweed Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 //     https://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, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 #![no_std]
15 
16 /// Pigweed's standard log levels
17 ///
18 /// Values are limited to 3 bits, to fit within the protobuf definition of
19 /// LogEntry's line_level in pw_log_rpc. These levels correspond with the log
20 /// levels from Python's logging library, but have different values.  The
21 /// values match the C/C++ implementation of the `pw_log` module.
22 ///
23 /// TODO: <pwbug.dev/314168783> - Add documentation on the meaning of the
24 /// log levels once it is written for Pigweed in general.
25 #[repr(u8)]
26 pub enum LogLevel {
27     Debug = 1,
28     Info = 2,
29     Warn = 3,
30     Error = 4,
31     Critical = 5,
32     // Level 6 is not defined in order to match the protobuf definition.
33     Fatal = 7,
34 }
35