Skip to content

Commit

Permalink
Fix windows console colours bug
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Aug 15, 2020
1 parent 63a5aa7 commit 914a761
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion quill/include/quill/handlers/ConsoleHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ class ConsoleColours
void set_colour(LogLevel log_level, WORD colour) noexcept;

/**
* @return True if we have enabled colours
* @return true if we are in terminal and have also enabled colours
*/
QUILL_NODISCARD bool can_use_colours() const noexcept;

/**
* @return true if we have setup colours
*/
QUILL_NODISCARD bool using_colours() const noexcept;

Expand Down
5 changes: 4 additions & 1 deletion quill/src/handlers/ConsoleHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ void ConsoleColours::set_colour(LogLevel log_level, WORD colour) noexcept
}

/***/
bool ConsoleColours::using_colours() const noexcept { return _can_use_colours && _using_colours; }
bool ConsoleColours::can_use_colours() const noexcept { return _can_use_colours && _using_colours; }

/***/
bool ConsoleColours::using_colours() const noexcept { return _using_colours; }

/***/
WORD ConsoleColours::colour_code(LogLevel log_level) const noexcept
Expand Down

0 comments on commit 914a761

Please sign in to comment.