Skip to content

Commit

Permalink
[Fix] SA_LOG_RAII can be used multiple time in the same scope
Browse files Browse the repository at this point in the history
  • Loading branch information
sqex-rmaxime committed Mar 29, 2024
1 parent 6b59d54 commit 8fd98f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Include/SA/Logger/Log/LogRAII.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace SA

#elif SA_DEBUG || SA_LOG_RELEASE_OPT

#define SA_LOG_RAII(...) SA::LogRAII __log_raii(\
#define SA_LOG_RAII(...) SA::LogRAII __SA_EVAL_PASTE(__log_raii, __LINE__)(\
__SA_SELECT_LOG_RAII_MACRO(__VA_ARGS__, __SA_LOG_RAII4, __SA_LOG_RAII3, __SA_LOG_RAII2, __SA_LOG_RAII1)(__VA_ARGS__)\
);

Expand Down
1 change: 1 addition & 0 deletions Tests/Prototype/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ int main()

{
SA_LOG_RAII("RAII 2!", Warning, SA.RAIIChan, L"After Normal and Before RAII 1");
SA_LOG_RAII("RAII 3!", Warning, SA.RAIIChan, L"After Normal and Before RAII 1 and Before RAII 2");
}

logger.Flush(); // ensure correct order with LoggerThread.
Expand Down

0 comments on commit 8fd98f5

Please sign in to comment.