MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ConDebugLevel

Function ConDebugLevel

src/console_cmds.cpp:1822–1839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1820}
1821
1822static bool ConDebugLevel(std::span<std::string_view> argv)
1823{
1824 if (argv.empty()) {
1825 IConsolePrint(CC_HELP, "Get/set the default debugging level for the game. Usage: 'debug_level [<level>]'.");
1826 IConsolePrint(CC_HELP, "Level can be any combination of names, levels. Eg 'net=5 ms=4'. Remember to enclose it in \"'\"s.");
1827 return true;
1828 }
1829
1830 if (argv.size() > 2) return false;
1831
1832 if (argv.size() == 1) {
1833 IConsolePrint(CC_DEFAULT, "Current debug-level: '{}'", GetDebugString());
1834 } else {
1835 SetDebugString(argv[1], [](std::string_view err) { IConsolePrint(CC_ERROR, "{}", err); });
1836 }
1837
1838 return true;
1839}
1840
1841static bool ConExit(std::span<std::string_view> argv)
1842{

Callers

nothing calls this directly

Calls 5

GetDebugStringFunction · 0.85
SetDebugStringFunction · 0.85
IConsolePrintFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected