• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Razakhel / RaZ / 18204674854

02 Oct 2025 07:56PM UTC coverage: 74.093%. Remained the same
18204674854

push

github

Razakhel
[Utils/Logger] Formatted output messages

- This notably avoids outputs to be jumbled when outputting from different threads, as there is now only one call to the stream

0 of 4 new or added lines in 1 file covered. (0.0%)

8334 of 11248 relevant lines covered (74.09%)

1757.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/RaZ/Utils/Logger.cpp
1
#include "RaZ/Utils/Logger.hpp"
2

3
#include "tracy/Tracy.hpp"
4

5
#include <iostream>
6

7
namespace Raz {
8

9
void Logger::error(const std::string& message) {
244✔
10
  if (static_cast<int>(m_logLevel) < static_cast<int>(LoggingLevel::ERROR))
244✔
11
    return;
238✔
12

13
  TracyMessageCS(message.c_str(), message.size(), tracy::Color::Red, 10);
14

15
  if (m_logFunc)
6✔
16
    m_logFunc(LoggingLevel::ERROR, message);
6✔
17
  else
NEW
18
    std::cerr << std::format("[RaZ] [Error] - {}\n", message);
×
19
}
20

21
void Logger::warn(const std::string& message) {
8✔
22
  if (static_cast<int>(m_logLevel) < static_cast<int>(LoggingLevel::WARNING))
8✔
23
    return;
3✔
24

25
  TracyMessageC(message.c_str(), message.size(), tracy::Color::Gold);
26

27
  if (m_logFunc)
5✔
28
    m_logFunc(LoggingLevel::WARNING, message);
5✔
29
  else
NEW
30
    std::cerr << std::format("[RaZ] [Warning] - {}\n", message);
×
31
}
32

33
void Logger::info(const std::string& message) {
8✔
34
  if (static_cast<int>(m_logLevel) < static_cast<int>(LoggingLevel::INFO))
8✔
35
    return;
4✔
36

37
  TracyMessageC(message.c_str(), message.size(), tracy::Color::DeepSkyBlue);
38

39
  if (m_logFunc)
4✔
40
    m_logFunc(LoggingLevel::INFO, message);
4✔
41
  else
NEW
42
    std::cout << std::format("[RaZ] [Info] - {}\n", message);
×
43
}
44

45
#if defined(RAZ_CONFIG_DEBUG) || defined(RAZ_FORCE_DEBUG_LOG)
46
void Logger::debug(const std::string& message) {
9,793✔
47
  if (static_cast<int>(m_logLevel) < static_cast<int>(LoggingLevel::DEBUG))
9,793✔
48
    return;
9,790✔
49

50
  TracyMessageC(message.c_str(), message.size(), tracy::Color::Gray);
51

52
  if (m_logFunc)
3✔
53
    m_logFunc(LoggingLevel::DEBUG, message);
3✔
54
  else
NEW
55
    std::cout << std::format("[RaZ] [Debug] - {}\n", message);
×
56
}
57
#endif
58

59
} // namespace Raz
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc