mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-07 08:25:26 +00:00
Add a log messages achievement.
This commit is contained in:
@@ -226,6 +226,7 @@ Embed(PROFILER_FILES TextIntro src/achievements/Intro.md TEXT)
|
||||
Embed(PROFILER_FILES TextLeaks src/achievements/Leaks.md TEXT)
|
||||
Embed(PROFILER_FILES TextLoadTrace src/achievements/LoadTrace.md TEXT)
|
||||
Embed(PROFILER_FILES TextLocks src/achievements/Locks.md TEXT)
|
||||
Embed(PROFILER_FILES TextLogMessages src/achievements/LogMessages.md TEXT)
|
||||
Embed(PROFILER_FILES TextManual src/achievements/Manual.md TEXT)
|
||||
Embed(PROFILER_FILES TextMemory src/achievements/Memory.md TEXT)
|
||||
Embed(PROFILER_FILES TextMemoryPools src/achievements/MemoryPools.md TEXT)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Log messages
|
||||
|
||||
Your debug output is worth keeping in the [trace log](#messagelog), not just on the console. `TracyMessageL( "config loaded" )` takes a string literal, `TracyMessage` takes a pointer and a size, and the `C` variants add a color so an entry stays findable in a long log.
|
||||
|
||||
All four always log with `Info` severity. `Warning` and `Error` are only reachable through `TracyLogString( severity, color, depth, txt )`, the underlying log call they all share. Most programs wrap it in their own small macros. Message macros with the `S` postfix capture a call stack as well.
|
||||
|
||||
The * Messages* button on the top bar opens the [Messages window](#messages). Every message gets a row with its time, thread, text and stack. Hovering a row highlights it on the timeline, clicking centers the view. Log something and look at the list!
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "data/TextLightFlame.hpp"
|
||||
#include "data/TextLoadTrace.hpp"
|
||||
#include "data/TextLocks.hpp"
|
||||
#include "data/TextLogMessages.hpp"
|
||||
#include "data/TextManual.hpp"
|
||||
#include "data/TextMemory.hpp"
|
||||
#include "data/TextMemoryPools.hpp"
|
||||
@@ -221,12 +222,19 @@ AchievementItem ai_chartValues = {
|
||||
.text = Unpack( TextPlots )
|
||||
};
|
||||
|
||||
AchievementItem ai_logMessages = {
|
||||
.id = "logMessages",
|
||||
.name = "Log messages",
|
||||
.text = Unpack( TextLogMessages )
|
||||
};
|
||||
|
||||
AchievementItem* ac_instrumentationIntroItems[] = {
|
||||
&ai_100million,
|
||||
&ai_instrumentationStatistics,
|
||||
&ai_annotateZones,
|
||||
&ai_markSections,
|
||||
&ai_chartValues,
|
||||
&ai_logMessages,
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ void View::DrawMessages()
|
||||
return;
|
||||
}
|
||||
|
||||
if( s_config.achievements ) Achieve( "logMessages" );
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text( ICON_FA_FILTER );
|
||||
ImGui::SameLine();
|
||||
|
||||
Reference in New Issue
Block a user