Skip to content

Commit

Permalink
[Update] LogLevel as enum class using SA::Support Flags
Browse files Browse the repository at this point in the history
  • Loading branch information
sqex-rmaxime committed Apr 1, 2024
1 parent 34dd27e commit 9b1b403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Include/SA/Logger/Log/LogLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#define SAPPHIRE_LOGGER_LOG_LEVEL_GUARD

#include <string>
#include <cstdint>

#include <SA/Support/Flags.hpp>

/**
* \file LogLevel.hpp
Expand All @@ -21,7 +22,7 @@
namespace SA
{
/// \brief All levels of logging.
enum LogLevel : uint8_t
enum class LogLevel : uint8_t
{
/// Normal level
Normal = (1 << 0),
Expand All @@ -47,9 +48,12 @@ namespace SA
Max = uint8_t(-1)
};

SA_DEFINE_ENUM_CLASS_FLAGS(LogLevel);

/// Shortcut alias.
using LogLvl = LogLevel;


/**
* \brief ToString implementation for LogLevel
*
Expand Down
2 changes: 1 addition & 1 deletion Include/SA/Logger/Streams/ALogStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace SA
LogChannelFilter channelFilter;

/// Level filter used for log in stream.
uint8_t levelFlags = LogLevel::Default;
uint8_t levelFlags = +LogLevel::Default;

/// \e Default virtual destructor.
virtual ~ALogStream() = default;
Expand Down

0 comments on commit 9b1b403

Please sign in to comment.