[Plugin] Execution Logger (0.3C version)
#1

Recently i went thru a low level overhaul of the main gamemode that i work with, it is sometimes very difficult to monitor what a script is doing in background - i am sure that a lot of you spent many sessions placing and removing printf calls all around code while trying to debug complex bugs and issues in your scripts.

So i built this plugin, which logs all operative calls. This excludes the GetPlayerxxx, IsPlayerxxx and a few other functions on purpose, as the functions which retrieve data from sa-mp aren't as important as those that SET it - but you can recompile the plugin to see those (and the resulting spam) as well., the defines are in the plugin to do so.

The calls and data is all outputted to sa-mp console / server log, here is a example output:

Code:
[19:51:48] IsPlayerConnected (playerid = 349, result = 0);
[19:51:48] SetTimer (funcname = "RunWeatherTimer" interval = 1000 repeating = 1, result = 3);
[19:51:48] SetTimer (funcname = "CheckIRCCommand" interval = 1000 repeating = 1, result = 4);
[19:51:48] CreateMenu (title = "Spectator" columns = 2 x = 125.00000 y = 130.00000 col1width = 190.00000 col2width = 0.0 = 150.00000, result = MENU:1);
[19:51:48] SetMenuColumnHeader (menuid = MENU:1 column = 0 columnheader = "Action", result = 1);
[19:51:48] SetMenuColumnHeader (menuid = MENU:1 column = 1 columnheader = "Mouse + Keys", result = 1);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "----------------------", result = 0);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "----------------------", result = 0);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "Previous player:", result = 1);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "~k~~PED_LOCK_TARGET~", result = 1);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "Next player:", result = 2);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "~k~~PED_FIREWEAPON~", result = 2);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "Change view:", result = 3);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "~k~~PED_DUCK~", result = 3);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "Exit spectator:", result = 4);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "~k~~PED_JUMPING~", result = 4);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "----------------------", result = 5);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = "----------------------", result = 5);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = " ", result = 6);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 1 menutext = " ", result = 6);
[19:51:48] AddMenuItem (menuid = MENU:1 column = 0 menutext = "                     Accept", result = 7);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 0, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 1, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 2, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 3, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 4, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 5, result = 1);
[19:51:48] DisableMenuRow (menuid = MENU:1 row = 6, result = 1);
[19:51:48] CreateObject (modelid = 14548 X = 335.81201 Y = 1004.71997 Z = 1950.50000 rX = 13.00000 rY = 0.00000 rZ = 0.00000 DrawDistance = 0.0 = 0.00000, result = 1);
[19:51:48] CreateObject (modelid = 14548 X = -1343.31775 Y = -272.34680 Z = 300.57529 rX = 13.00000 rY = 0.00000 rZ = 46.81210 DrawDistance = 0.0 = 0.00000, result = 2);
[19:51:48] CreateObject (modelid = 14548 X = 282.26001 Y = 1076.01001 Z = 0.00000 rX = 13.00000 rY = 0.00000 rZ = 90.00000 DrawDistance = 0.0 = 0.00000, result = 3);
[19:51:48] CreateObject (modelid = 4847 X = -1117.63000 Y = 1483.83997 Z = 1.55000 rX = -8.00000 rY = 0.00000 rZ = -64.82000 DrawDistance = 0.0 = 0.00000, result = 4);
You can see that the output is pretty well detailed.

The calls can also include streamer plugin calls, as long as the plugin is set to be loaded after the streamer (put ExecLogger at the end of plugin server.cfg line), this also works with other plugins that call sa-mp natives.

With detailed list of calls you are sending to sa-mp, you can optimize your script better. It will help you find redundant calls, unused code, wrong data, etc.. it also works well in tandem with Zeex's crashdetect plugin - you can see which sa-mp natives were made before the crash, and that helps you locate the problem in your code when there is no crashdetect stack trace)

Thanks to: Zeex, BlueG.

Be advised, that this is a 0.3C version - it will probably work in 0.3D - it is not tested there, so try it but in theory it should work directly.

Download for windows:
http://www.mathpudding.com/topsecretsamp/ExecLogger.rar

Download for linux:
http://www.mathpudding.com/topsecret...gger_linux.rar

IF YOU DO NOT UNDERSTAND WHAT THIS PLUGIN DOES, DO NOT JUST INSTALL IT BLINDLY FOR NO GOOD REASON, ESPECIALLY ON A LIVE SERVER - THIS IS FOR LOCAL TESTING ONLY.

source code (copy into examples folder of Zeex's plugin SDK and compile with code::blocks or make):
http://www.mathpudding.com/topsecret...Logger_src.rar
Reply


Messages In This Thread
Execution Logger (0.3C version) - by JernejL - 22.10.2011, 20:10
Re: Execution Logger (0.3C version) - by RyDeR` - 22.10.2011, 20:11
Re: Execution Logger (0.3C version) - by Dark_Kostas - 22.10.2011, 20:19
Re: Execution Logger (0.3C version) - by Whitetiger - 22.10.2011, 20:22
Re: Execution Logger (0.3C version) - by wups - 22.10.2011, 20:37
Re: Execution Logger (0.3C version) - by GangsTa_ - 22.10.2011, 20:43
Re: Execution Logger (0.3C version) - by Ricop522 - 22.10.2011, 20:48
Re: Execution Logger (0.3C version) - by raz0x - 22.10.2011, 20:51
Re: Execution Logger (0.3C version) - by Hiddos - 22.10.2011, 21:34
Re: Execution Logger (0.3C version) - by JernejL - 22.10.2011, 21:51
AW: Execution Logger (0.3C version) - by Meta - 22.10.2011, 21:58
Re: Execution Logger (0.3C version) - by SpiderWalk - 22.10.2011, 22:10
Re: Execution Logger (0.3C version) - by Luis- - 22.10.2011, 23:21
Re: Execution Logger (0.3C version) - by [L3th4l] - 22.10.2011, 23:54
Re: Execution Logger (0.3C version) - by Chaser98 - 23.10.2011, 00:42
Re: Execution Logger (0.3C version) - by Scenario - 23.10.2011, 01:09
Respuesta: Execution Logger (0.3C version) - by CrowClaws - 23.10.2011, 01:43
Re: Execution Logger (0.3C version) - by Snipa - 23.10.2011, 02:01
Re: Execution Logger (0.3C version) - by Slice - 23.10.2011, 09:53
Re: Execution Logger (0.3C version) - by TheArcher - 23.10.2011, 10:03
Re: Execution Logger (0.3C version) - by playbox12 - 23.10.2011, 10:09
Re: Execution Logger (0.3C version) - by GangsTa_ - 23.10.2011, 10:10
Re: Execution Logger (0.3C version) - by wups - 23.10.2011, 11:06
Re: Execution Logger (0.3C version) - by Jay_ - 23.10.2011, 11:18
Re: Execution Logger (0.3C version) - by JernejL - 23.10.2011, 13:35
Respuesta: Execution Logger (0.3C version) - by robanswe - 01.11.2011, 11:07
Re: Execution Logger (0.3C version) - by leong124 - 01.11.2011, 11:28
Re: Execution Logger (0.3C version) - by _[HuN]_Epsilon_ - 01.11.2011, 17:13
Re: Execution Logger (0.3C version) - by robanswe - 01.11.2011, 17:37
Re: Execution Logger (0.3C version) - by Norn - 01.11.2011, 18:05
Re: Execution Logger (0.3C version) - by [L3th4l] - 09.11.2011, 00:56
Re: Execution Logger (0.3C version) - by JernejL - 15.11.2011, 22:53
Re: Execution Logger (0.3C version) - by Chrillzen - 16.11.2011, 05:31
Re: Execution Logger (0.3C version) - by leong124 - 23.01.2012, 17:26
Re: Execution Logger (0.3C version) - by Danny - 04.03.2012, 09:13
Re: Execution Logger (0.3C version) - by The__ - 07.04.2012, 19:36
Re: Execution Logger (0.3C version) - by iPLEOMAX - 07.04.2012, 20:20
Re: Execution Logger (0.3C version) - by The__ - 07.04.2012, 20:29
Re: Execution Logger (0.3C version) - by iPLEOMAX - 07.04.2012, 21:42
Re: Execution Logger (0.3C version) - by Toreno - 08.04.2012, 10:37
Re: Execution Logger (0.3C version) - by The__ - 08.04.2012, 11:22
Re: Execution Logger (0.3C version) - by Calgon - 03.05.2012, 14:09
Re: Execution Logger (0.3C version) - by leong124 - 03.05.2012, 17:09
Re: Execution Logger (0.3C version) - by JernejL - 27.06.2012, 07:46
Re: Execution Logger (0.3C version) - by CaHbKo - 27.06.2012, 08:02
Re: Execution Logger (0.3C version) - by JernejL - 16.07.2012, 17:51
Re: Execution Logger (0.3C version) - by TheArcher - 16.07.2012, 18:07
Re: Execution Logger (0.3C version) - by acuworld - 17.07.2012, 09:56
Re: Execution Logger (0.3C version) - by Jochemd - 17.07.2012, 14:08
Re: Execution Logger (0.3C version) - by Plovix - 20.07.2012, 11:47
Re: Execution Logger (0.3C version) - by dudaefj - 11.09.2012, 22:37
Re: Execution Logger (0.3C version) - by Edvin - 12.09.2012, 10:20
Re: Execution Logger (0.3C version) - by TheArcher - 12.09.2012, 10:58
Re: Execution Logger (0.3C version) - by Iceaac - 14.12.2012, 19:44
AW: Execution Logger (0.3C version) - by Mellnik - 20.07.2014, 13:39
Re: AW: Execution Logger (0.3C version) - by iFarbod - 20.07.2014, 13:48

Forum Jump:


Users browsing this thread: 2 Guest(s)