MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / updateFormatSpec

Method updateFormatSpec

src/thundersvm/util/log.cpp:1485–1532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1483 }
1484
1485 void LogFormat::updateFormatSpec(void) {
1486 // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet.
1487 if (m_level == Level::Debug) {
1488 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1489 base::consts::kDebugLevelLogValue);
1490 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1491 base::consts::kDebugLevelShortLogValue);
1492 } else if (m_level == Level::Info) {
1493 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1494 base::consts::kInfoLevelLogValue);
1495 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1496 base::consts::kInfoLevelShortLogValue);
1497 } else if (m_level == Level::Warning) {
1498 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1499 base::consts::kWarningLevelLogValue);
1500 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1501 base::consts::kWarningLevelShortLogValue);
1502 } else if (m_level == Level::Error) {
1503 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1504 base::consts::kErrorLevelLogValue);
1505 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1506 base::consts::kErrorLevelShortLogValue);
1507 } else if (m_level == Level::Fatal) {
1508 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1509 base::consts::kFatalLevelLogValue);
1510 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1511 base::consts::kFatalLevelShortLogValue);
1512 } else if (m_level == Level::Verbose) {
1513 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1514 base::consts::kVerboseLevelLogValue);
1515 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1516 base::consts::kVerboseLevelShortLogValue);
1517 } else if (m_level == Level::Trace) {
1518 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier,
1519 base::consts::kTraceLevelLogValue);
1520 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier,
1521 base::consts::kTraceLevelShortLogValue);
1522 }
1523 if (hasFlag(base::FormatFlags::User)) {
1524 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentUserFormatSpecifier,
1525 m_currentUser);
1526 }
1527 if (hasFlag(base::FormatFlags::Host)) {
1528 base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentHostFormatSpecifier,
1529 m_currentHost);
1530 }
1531 // Ignore Level::Global and Level::Unknown
1532 }
1533
1534// TypedConfigurations
1535

Callers

nothing calls this directly

Calls 1

hasFlagFunction · 0.85

Tested by

no test coverage detected