azure-core
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
9#pragma once
10
11#include <functional>
12#include <string>
13
14namespace Azure { namespace Core { namespace Diagnostics {
18 class Logger final {
19 public:
24 // https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/LogLevel.java
25 enum class Level : int
26 {
28 Verbose = 1,
29
31 Informational = 2,
32
34 Warning = 3,
35
37 Error = 4,
38 };
39
46 static void SetListener(std::function<void(Level level, std::string const& message)> listener);
47
54 static void SetLevel(Level level);
55
56 private:
61 Logger() = delete;
62
68 ~Logger() = delete;
69 };
70}}} // namespace Azure::Core::Diagnostics
Log message handler.
Definition logger.hpp:18
static void SetLevel(Level level)
Sets the log message level an application is interested in receiving.
Definition logger.cpp:53
static void SetListener(std::function< void(Level level, std::string const &message)> listener)
Sets the function that will be invoked to report an Azure SDK log message.
Definition logger.cpp:45
Level
Log message level.
Definition logger.hpp:26
@ Warning
Logging level when a function fails to perform its intended task.
@ Informational
Logging level when a function operates normally.
@ Error
Logging level for failures that the application is unlikely to recover from.
@ Verbose
Logging level for detailed troubleshooting scenarios.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57