Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Unhelpful error trace
- - By Newton [de] Date 2011-12-11 19:09
Since some time, the error trace output looks a bit messy. Especially for objects that hold arrays of other objects. Here an example:

ERROR: object call: no function "setMenu" in object "{#338, hWeaponAnimStrike = nil, Prototype = {Axe, ...}}".
by: AddItem({#338, hWeaponAnimStrike = nil, Prototype = {Axe, ...}},1) (obj #657) (planet\Objects.ocd\HUD.ocd\Menu.ocd\Script.c:97)
by: PutObjects({Menu = {#658, ...}, Object = {#32, ...}},{Menu = {#657, ...}, Object = {#325, ...}},{#659, item_object = {#338, ...}, Parallaxity = [...], item_data = [...], Visibility = 2, Name = "Axe", Prototype = {GUI_MenuItem, ...}, item_count = 1, MouseDragImage = {#338, ...}, item_menu = {#658, ...}, item_size = 1104},1) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:193)
by: MoveObjects({Menu = {#658, ...}, Object = {#32, ...}},{Menu = {#657, ...}, Object = {#325, ...}},{#659, item_object = {#338, ...}, Parallaxity = [...], item_data = [...], Visibility = 2, Name = "Axe", Prototype = {GUI_MenuItem, ...}, item_count = 1, MouseDragImage = {#338, ...}, item_menu = {#658, ...}, item_size = 1104},1) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:231)
by: OnItemSelection({#658, menu_items = [...], Parallaxity = [...], menu_shown = true, Visibility = 2, Prototype = {GUI_Menu, ...}, dragdrop = true, menu_commander = {#656, ...}, menu_object = {#325, ...}},{#659, item_object = {#338, ...}, Parallaxity = [...], item_data = [...], Visibility = 2, Name = "Axe", Prototype = {GUI_MenuItem, ...}, item_count = 1, MouseDragImage = {#338, ...}, item_menu = {#658, ...}, item_size = 1104}) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:246)
by: OnItemSelection({#659, item_object = {#338, ...}, Parallaxity = [...], item_data = [...], Visibility = 2, Name = "Axe", Prototype = {GUI_MenuItem, ...}, item_count = 1, MouseDragImage = {#338, ...}, item_menu = {#658, ...}, item_size = 1104}) (obj #658) (planet\Objects.ocd\HUD.ocd\Menu.ocd\Script.c:264)
by: MouseSelection() (obj #659) (planet\Objects.ocd\HUD.ocd\Menu.ocd\MenuItem.ocd\Script.c:37)


The same holds for Log("%v",someobj).

Maikel and me think the log output of objects should be limited to object number and name (as it was before?), for anything more detailed, developers can and should use the IDE (eclipse) as this output as such is not helpful anyway.
Günther, I guess you implemented the detailed object logging, can you revert it to a state that is readable? :-)
Parent - - By Günther [de] Date 2011-12-14 21:17
That would make Arrays and pure PropLists that much more verbose than Objects. Okay, objects and definitions you can examine later given the Number resp. Id, so verbosity there isn't needed as much. Or do you have other arguments? I tried to find a balance between too much and too little information, and a straight revert isn't possible since you could kill the engine by printing an array with a loop before, so we need some more design work than just "readable"...
Reply
Parent - By Newton [de] Date 2011-12-14 21:26
My suggestion is to treat objects differently than proplists in the trace log. It should look like this:

ERROR: object call: no function "setMenu" in object #338.
by: AddItem(obj #338,1) (obj #657) (planet\Objects.ocd\HUD.ocd\Menu.ocd\Script.c:97)
by: PutObjects({Menu = obj #658, Object = obj #32},{Menu = obj #657, Object = obj #325}, obj #659,1) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:193)
by: MoveObjects({Menu = obj #658, Object = obj #32},{Menu = obj #657, Object = obj #325}, obj #659,1) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:231)
by: OnItemSelection(obj #658, obj #659) (obj #656) (planet\Objects.ocd\HUD.ocd\Menu.ocd\ContentsMenuController.ocd\Script.c:246)
by: OnItemSelection(obj #659) (obj #658) (planet\Objects.ocd\HUD.ocd\Menu.ocd\Script.c:264)
by: MouseSelection() (obj #659) (planet\Objects.ocd\HUD.ocd\Menu.ocd\MenuItem.ocd\Script.c:37)
Parent - - By Sven2 [de] Date 2011-12-14 21:53
What about an ability to attach a format string as a property to a proplist? So you would do something like definition.displayString = "$name$ #$number$", and the toString-method of proplists would respect that property if it finds it?
Parent - By Caesar [de] Date 2011-12-14 22:15
I'm not too sure I like that much waste-data for debugging purposes. But if you do this, be sure to give Objects a toString callback and take a good thought about what to do in case of an error in that function...
Up Topic Development / Developer's Corner / Unhelpful error trace

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill