|
| 1 | +.. |
| 2 | + # ******************************************************************************* |
| 3 | + # Copyright (c) 2024 Contributors to the Eclipse Foundation |
| 4 | + # |
| 5 | + # See the NOTICE file(s) distributed with this work for additional |
| 6 | + # information regarding copyright ownership. |
| 7 | + # |
| 8 | + # This program and the accompanying materials are made available under the |
| 9 | + # terms of the Apache License Version 2.0 which is available at |
| 10 | + # https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + # |
| 12 | + # SPDX-License-Identifier: Apache-2.0 |
| 13 | + # ******************************************************************************* |
| 14 | +
|
| 15 | +Logging |
| 16 | +####### |
| 17 | + |
| 18 | +Log Level Guidelines |
| 19 | +==================== |
| 20 | + |
| 21 | +Logging is a critical part of both application development and maintenance. A well-defined log level structure helps separate the concerns of developers and end users, ensuring that relevant information is communicated at the right level of detail. |
| 22 | + |
| 23 | +Developer-Oriented Log Levels |
| 24 | +----------------------------- |
| 25 | + |
| 26 | +- **TRACE** |
| 27 | + Used for logging detailed application events, such as when a resource is created or destroyed. |
| 28 | + *Example:* Logging the creation of a new object instance. |
| 29 | + |
| 30 | +- **DEBUG** |
| 31 | + Used for debugging purposes, particularly when a function returns a result (e.g., ``Result`` in Rust or an ``expected`` in C++) that contains an error. |
| 32 | + *Example:* Logging unexpected errors during function execution to help diagnose issues. |
| 33 | + |
| 34 | +User-Oriented Log Levels |
| 35 | +------------------------ |
| 36 | + |
| 37 | +- **INFO** |
| 38 | + Provides general information about the application's operations that may be of interest to the user. |
| 39 | + *Example:* Notifying the user of a successful operation or process completion. |
| 40 | + |
| 41 | +- **WARN** |
| 42 | + Indicates warnings for the user when internal recoverable misbehaviors occur, but the application's functionality is not severely restricted. |
| 43 | + *Example:* Logging minor issues that could lead to future problems but are currently being handled gracefully. |
| 44 | + |
| 45 | +- **ERROR** |
| 46 | + Signals severe failures that are still recoverable, meaning the error is contained within a result (e.g., ``Result`` in Rust or an ``expected`` in C++) and the application can continue if the user takes corrective action. |
| 47 | + *Example:* Logging errors that require user intervention to recover from a malfunction. |
| 48 | + |
| 49 | +- **FATAL** |
| 50 | + Indicates critical failures where the application will terminate (panic) after the log output. |
| 51 | + *Example:* Logging a critical error that forces the application to shut down immediately. |
0 commit comments