Sir R. M8gic1an
2010-12-02 12:56:52
procedure MSI_CloseHeader(closer: string);
begin
MSI_Debug('Result: ' + closer);
Dec(CurrDebugLevel);
end;
What change would this make?
Before
[ Ora ] -- Created Debug file
[ Ora ] -- Gathering report info, please wait...
[ Ora ] -- MSI_SetupPlayer
[ Ora ] ------ Scanning for randoms...
[ Ora ] ---- MSI_BestTool
[ Ora ] ------ CurrentSkill level: 39
[ Ora ] ---- MSI_BestTool: Adamant pickaxe
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Adamant pickaxe
[ Ora ] ---- MSI_FindTool: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Mithril pickaxe
[ Ora ] ---- MSI_FindTool: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Steel pickaxe
[ Ora ] ---- MSI_FindTool: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Found DTM: Iron pickaxe
[ Ora ] ---- MSI_FindTool: True
[ Ora ] -- MSI_SetupPlayer: True
[ Ora ] -- MSI_AutoObjects
After
[ Ora ] -- Created Debug file
[ Ora ] -- Gathering report info, please wait...
[ Ora ] -- MSI_SetupPlayer
[ Ora ] ------ Scanning for randoms...
[ Ora ] ---- MSI_BestTool
[ Ora ] ------ CurrentSkill level: 39
[ Ora ] ------ Result: Adamant pickaxe
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Adamant pickaxe
[ Ora ] ------ Result: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Mithril pickaxe
[ Ora ] ------ Result: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Failed to find tool: Steel pickaxe
[ Ora ] ------ Result: False
[ Ora ] ---- MSI_FindTool - GameTab: 26
[ Ora ] ------ Found DTM: Iron pickaxe
[ Ora ] ------ Result: True
[ Ora ] ---- Result: MSI_SetupPlayer: True
[ Ora ] -- MSI_AutoObjects
From looking at the debug atm it is visible there's still some places to add it to.
I think this way things look cleaner.
For low-level functions (functions that have no MSI subfunctions) 'Result: true' is usually enough debug info.
For high-level functions such as MSI_SetupPlayer, printing out 'Result: MSI_SetupPlayer: true' makes it easy to remember what was going on before.
I think this is an improvement. Opinions?
~RM