1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Software Name : libits-client
* SPDX-FileCopyrightText: Copyright (c) Orange SA
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT license,
* see the "LICENSE.txt" file for more details or https://opensource.org/license/MIT/
*
* Authors: see CONTRIBUTORS.md
*/
use Logger;
use info;
/// Creates a logger that outputs to stdout.
///
/// This function initialises a logger using the `flexi_logger` crate, which logs messages to the standard output (stdout).
/// Logger's log level is set based on the environment variable or defaults to "info".
///
/// # Returns
///
/// A `Result` containing a `flexi_logger::LoggerHandle` if the logger is successfully initialized, or a boxed `dyn std::error::Error` if an error occurs.
///
/// # Errors
///
/// This function will return an error if the logger fails to initialize.
///
/// # Examples
///
/// ```rust
/// use libits::client::logger::create_stdout_logger;
/// let _logger = create_stdout_logger().expect("Logger initialization failed");
/// ```
///
/// # Dependencies
///
/// This function requires the `flexi_logger` and `log` crates.
///
/// # Notes
///
/// Logger is configured to print messages to stdout and includes a message indicating that the logger is ready.
///
/// # See Also
///
/// - `flexi_logger::Logger`
/// - `log::info`