Logging through primal::log #6
No assignees
Labels
No labels
area/build
area/content
area/editor
area/engine
area/graphics
area/platform
area/repo-wide
area/tests
area/tools
bug
optional
roadmap
size/L
size/M
size/S
No project
No milestone
Blocks
Depends on
#10 Platform detection and the Linux platform layer (SDL3)
UnflavoredMeson/Primal_Plus_Plus
#16 Job system module primal.jobs
UnflavoredMeson/Primal_Plus_Plus
#24 ShaderCompilerTool at build time
UnflavoredMeson/Primal_Plus_Plus
#5 Unit tests with doctest
UnflavoredMeson/Primal_Plus_Plus
Reference
No Branch/Tag specified
Notifications
1 participant
Due date
No due date set.
Reference
UnflavoredMeson/Primal_Plus_Plus#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every later system reports problems. With one logging API from the start, nothing is written against
printforOutputDebugStringand converted later, and the editor (S7) can show the same log.Decided
log::debug/info/warning/error(log::Category::x, "format {}", args)inEngine/Core/Log.h, withstd::formatsyntax. No trailing\n, no "Vulkan:" prefixes: the category says it.DXCall), headers and game code all need to call it.error()waits until the message is written (so it is seen before a crash); don't call it every frame.Tools/check_log_usage.pyfails on directprintf/std::cout/OutputDebugString.log::set_console_style(log::ConsoleStyle::plain).Read first
UnflavoredMeson/Primal#19.Engine/Core/EngineWin32.cpponmaster(where output goes today).Steps
UnitTests/LogTests.cppfor formatting, categories and the ring buffer (a test sink that records messages).Log.h/Log.cppwith a synchronous sink until the tests pass.-fsanitize=thread) once.OutputDebugString/printfin the engine and tools.check_log_usage.pyand add it to your check script.Done when
check_log_usage.pyreports nothing.EngineTest.lognext to the executable on both OSes.Claude can help with
check_log_usage.py.Learn
std::formatchecks format strings at compile time (std::format_string).error().