Firefox PHP

cannot echo debug info?

Posted by Terradon 
cannot echo debug info?
August 15, 2015 05:40PM
I am missing something terribly!
it seems i am not capable to echo debug info?

I have some troubles with coding a module, (it isn't the first one for me), and now i am so desperade, i want to echo/dump values, arrays, created sql and so on. But it seems not to work? I am totally blind in what i am doing now, i want to check several things, but i can't?
Re: cannot echo debug info?
August 16, 2015 05:52AM
first of all: you are kind of spamming this forum now.
Without telling what you did and what the result was, its really hard to help at all.

You can output stuff, easily, but I'd recommend to either log it to the event logging module or to some file on the server.
Also usually if you don't get to output something, that code is often simply not reached.


Thomas Seifert
Re: cannot echo debug info?
August 16, 2015 09:27AM
My apologizes for the spam, however it was not ment as spam, I was trying to seperate different coding issues i have.
I have tried different approaches during the last week, but none of them i could succesfully finish them.

I am trying to write a module so users can block specific users from sending private messages to them. (we have had some harassment issues).

I will try the logging system.
As soon as this module is ready, i will publish the final code here.

Anyways, thanks for your (free of charge) comments.
Re: cannot echo debug info?
August 17, 2015 03:25AM
Hi Terradon,

I use two kinds of debugging output:

1. Event Logging Module (included in core distribution)

You'll find the output under Phorum Admin, Modules, Event Logging Module Settings, View logged events.

Language: PHP
// Debugging with event logging module if (function_exists(';event_logging_writelog';)) { event_logging_writelog(array( ';source'; => ';mailing_list';, ';message'; => ';Attachments processed';, ';details'; => "Processed the following attachments:\n".$debug_message, ';loglevel'; => EVENTLOG_LVL_INFO, ';category'; => EVENTLOG_CAT_MODULE ) ); }

2. HTML comment in page output

You'll find the output in your page source.

Language: PHP
// Debugging with echo echo ';<!-- var=';.print_r($var, true).'; -->';;

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: cannot echo debug info?
August 17, 2015 07:54AM
Playing with the eventlogger now,like:
Language: PHP
if (function_exists(';event_logging_writelog';)) { event_logging_writelog(array( "message" => "<entering blockproces>" )); }

WOW, powerfull tool!

thanks!
Sorry, only registered users may post in this forum.

Click here to login