Raised This Month: $51 Target: $400
 12% 

what is the best debug method to get the full error log (cs 1.6)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 06-14-2016 , 14:35   what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #1

what is the best debug method to get the full error log and thnx
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !

Last edited by Old.School; 06-14-2016 at 14:36.
Old.School is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 06-25-2016 , 23:57   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #2

bump!
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-26-2016 , 00:28   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #3

An error log is already provided by the game engine and AMX Mod X. An error log is typically only a part of the debugging process since many bugs will not output an error.

The "best" method for debugging depends on what you are trying to debug. I usually print to console (or to file) the values that are relevant to the bug so I can see how the variable values as the code runs. IMO, that's really all you need.
__________________
fysiks is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 06-27-2016 , 18:48   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #4

my problem is one of the plugins installed on my server using ham killed post crashing the server some times when player kill another player and i dont have time to create the server from the begin
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 06-28-2016 , 00:16   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #5

Quote:
Originally Posted by Old.School View Post
my problem is one of the plugins installed on my server using ham killed post crashing the server some times when player kill another player and i dont have time to create the server from the begin
So, if you do not want to think to much and this is extreme, you can place a print out before every statement on that plugin to find out on which line it is crashing. Example:

Code:
/**  * Write debug messages to server's console and '_my_plugin_log.log' stored on 'addons/amxmodx/logs/'.  *  * @param text the debug message, if omitted its default value is ""  * @param any the variable number of formatting parameters  */ stock print_logger( message[] = "", any: ... ) {     static formated_message[ 384 ];     vformat( formated_message, charsmax( formated_message ), message, 2 );         writeToTheDebugFile( formated_message ); } stock writeToTheDebugFile( formated_message[] ) {     static Float:gameTime;     gameTime = get_gametime();         // '_my_plugin_log.log' will be stored on 'addons/amxmodx/logs/'     log_to_file( "_my_plugin_log.log", "{%3.4f} %s", gameTime, formated_message ); } public plugin_init() {     print_logger( "Before: round_end_event" );     register_logevent( "round_end_event",       2, "1=Round_End" );         print_logger( "Before: say" );     register_clcmd( "say", "cmd_say", -1 );         print_logger( "Before: say_team" );     register_clcmd( "say_team", "cmd_say", -1 );         print_logger( "Before: votemap" );     register_clcmd( "votemap", "cmd_HL1_votemap" );         print_logger( "Before: gal_cancelvote" );     register_concmd( "gal_cancelvote", "cmd_cancelVote", ADMIN_MAP );         print_logger( "Before: gal_createmapfile" );     register_concmd( "gal_createmapfile", "cmd_createMapFile", ADMIN_RCON );         print_logger( "after: plugin_init(0) end." ); }


Update:

If you do not know what plugin it is you can do this on all plugins you suspect (cumbersome) or give this another thread a try 'CS1.6 Cannot pull up amx_help or any screens'.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 06-28-2016 at 00:28. Reason: update
addons_zz is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 06-28-2016 , 01:08   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #6

thnx alot man i will try it
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 07-04-2016 , 20:44   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #7

still not solved the log showing something like that :

Quote:
L 06/29/2016 - 0411: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 0411: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 05:18:15: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 05:18:15: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 06:00:07: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 06:00:07: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 06:41:23: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 06:41:23: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 07:00:07: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 07:00:07: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 07:518: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 07:518: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 083:16: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 083:16: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 09:18:03: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 09:18:03: {1.0000} after: plugin_init(0) end.
any help?
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-04-2016 , 21:00   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #8

And how do you expect us to help you with a specific problem when you ask an extremely generic question?

Also, the fact that you are doing anything with fullupdate probably means you are doing something wrong or are assuming something that isn't true. Then again, I can't be for sure since you haven't actually asked any questions that we can answer.

Since you are scripting a plugin, you should post a topic in the Scripting Help section where you attach your .sma file and describe what you are actually trying to achieve and what you are having an issue with.
__________________

Last edited by fysiks; 07-04-2016 at 21:00.
fysiks is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 07-04-2016 , 23:18   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #9

fysiks clcmd_fullupdate... is just log of addons_zz method used on only headshot plugin for test and what i mean is how i can know if there is a problem with this log ...

and my problem is i have a server which he have crash problem and the most reasons of crash is when the player kill another player and this happen randomly so i can't test by killing player or something like that...
and i have a lot of work so i didn't have time to build the server from where i started
any idea about a good way to know the problem from where ?
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 07-05-2016 , 08:25   Re: what is the best debug method to get the full error log (cs 1.6)
Reply With Quote #10

Quote:
Originally Posted by Old.School View Post
fysiks clcmd_fullupdate... is just log of addons_zz method used on only headshot plugin for test and what i mean is how i can know if there is a problem with this log ...
Quote:
Originally Posted by Old.School View Post
still not solved the log showing something like that :
Quote:
L 06/29/2016 - 0411: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 0411: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 05:18:15: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 05:18:15: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 06:00:07: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 06:00:07: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 06:41:23: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 06:41:23: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 07:00:07: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 07:00:07: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 07:518: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 07:518: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 083:16: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 083:16: {1.0000} after: plugin_init(0) end.
L 06/29/2016 - 09:18:03: {1.0000} Before: clcmd_fullupdate
L 06/29/2016 - 09:18:03: {1.0000} after: plugin_init(0) end.
any help?
You do not got that method right. For example, if you plugin has 6 code lines, you must to do at least 7 print outs.
By your log I see you just used 2 print outs. Does you plugin has only 1 line? I think not.
And also, we can see you plugin was loaded multiple times (plugin_init() called multiple times).
Then or you changed level, or your server crashed each time and was restarted.
You have to know what it was, and then see where (code line) your plugin stopped running/crashed the server.

Example, supposing this is my whole plugin:
Code:
public plugin_init() {     register_logevent( "round_end_event",       2, "1=Round_End" );     register_clcmd( "say", "cmd_say", -1 );     register_clcmd( "say_team", "cmd_say", -1 ); } public my_cool_foward() {     register_clcmd( "votemap", "cmd_HL1_votemap" );     register_concmd( "gal_cancelvote", "cmd_cancelVote", ADMIN_MAP );     register_concmd( "gal_createmapfile", "cmd_createMapFile", ADMIN_RCON ); }

Became this:
Code:
public plugin_init() {     print_logger( "( plugin_init ) Before: round_end_event" );     register_logevent( "round_end_event",       2, "1=Round_End" );         print_logger( "( plugin_init ) Before: say" );     register_clcmd( "say", "cmd_say", -1 );         print_logger( "( plugin_init ) Before: say_team" );     register_clcmd( "say_team", "cmd_say", -1 );         print_logger( "after: plugin_init(0) end." ); } public my_cool_foward() {     print_logger( "( my_cool_foward ) Before: votemap" );     register_clcmd( "votemap", "cmd_HL1_votemap" );         print_logger( "( my_cool_foward ) Before: gal_cancelvote" );     register_concmd( "gal_cancelvote", "cmd_cancelVote", ADMIN_MAP );         print_logger( "( my_cool_foward ) Before: gal_createmapfile" );     register_concmd( "gal_createmapfile", "cmd_createMapFile", ADMIN_RCON );     print_logger( "after: my_cool_foward(0) end." ); }
Hence, if it stop printing not on 'after: my_cool_foward(0) end.' or 'after: plugin_init(0) end.', it means it crashed on the last line it was outputted, then you know where to start thinking about, when you do not have any ideia.

Why would this line crash to the plugin? How to do this line to crash the plugin? How to avoid this line to crash the plugin? What are the parameters this line is using? What are the parameters this line is supposed to be using?
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 07-05-2016 at 17:47. Reason: misspellings
addons_zz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode