7#include "azure/core/dll_import_export.hpp"
15namespace Azure {
namespace Core {
namespace Diagnostics {
namespace _internal {
59 std::is_same<int, std::underlying_type<Logger::Level>::type>::value ==
true,
60 "Logger::Level values must be representable as lock-free");
62 static_assert(ATOMIC_INT_LOCK_FREE == 2,
"atomic<int> must be lock-free");
64 static_assert(ATOMIC_BOOL_LOCK_FREE == 2,
"atomic<bool> must be lock-free");
66 static AZ_CORE_DLLEXPORT std::atomic<bool> g_isLoggingEnabled;
67 static AZ_CORE_DLLEXPORT std::atomic<Logger::Level> g_logLevel;
101 ~Stream() { Log::Write(m_level, m_stream.str()); }
102 Stream(Stream
const&) =
delete;
103 Stream& operator=(Stream
const&) =
delete;
110 template <
typename T> std::ostream& operator<<(T val) {
return m_stream << val; }
113 std::stringstream m_stream;
127 return g_isLoggingEnabled && level >= g_logLevel;
149 static void Write(
Logger::Level level, std::string
const& message);
155 static void EnableLogging(
bool isEnabled);
Level
Log message level.
Definition logger.hpp:26
Handling log messages from Azure SDK.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57