Hi.
It could be a silly question but I had no answer by searching.
Why 'echo' or 'print' doesn´t work?
I´m triyng to trace my code with simple displays but I can´t see them
Using echo to trace
Moderators: Developer, Contributor
Re: Using echo to trace
Depends on where you have placed your code.
Your code might not be executed at all, or you can't see the output as the page is sent ompletely new shortly after your code has been executed.
To find out if it's executed, just place some line like in it.
Your code might not be executed at all, or you can't see the output as the page is sent ompletely new shortly after your code has been executed.
To find out if it's executed, just place some line like
Code: Select all
die ("Hello I am here");
Re: Using echo to trace
Hi. Thanks.
My code is executing.
Actually I´m tracing by using 'bugnote_add' function.
Even thoug I´v tried your suggestion and it works, the process die . But replacing die by echo does anything.
My code is executing.
Actually I´m tracing by using 'bugnote_add' function.
Even thoug I´v tried your suggestion and it works, the process die . But replacing die by echo does anything.
Re: Using echo to trace
Anything? I suppose you mean nothing.
If I understand right, you want to trace a low level function of Mantis (bugnote_add) by using echo statements.
This is a bad idea in general, as most of the time a new page will be generated after the echo, so you will not see the outpout.
You could add another "die" after your "echo" and I am pretty sure you will see your echo.
It would be better to learn how to debug PHP applications (e.g. by using Xdebug) in general, or use some PHP standard functionality for logging https://www.loggly.com/ultimate-guide/p ... ing-basics or use/check how function log_event is used in Mantis depending on options $g_log_level and $g_log_destination
Re: Using echo to trace
Sorry about my english. As bad as my php programming.
Of course I meant "nothing".
I´m trying to trace a plugin. I´m using bugnote_add to trace, because I don´t see echoes. Write in a bugnote the text I cannot display.
My code is working. So I don´t need help with that. It´s only that seems strange cannot use echo to trace.
Another reason to hate php
Anyway, I will check your contributions.
Thank you for your time.
Of course I meant "nothing".
I´m trying to trace a plugin. I´m using bugnote_add to trace, because I don´t see echoes. Write in a bugnote the text I cannot display.
My code is working. So I don´t need help with that. It´s only that seems strange cannot use echo to trace.
Another reason to hate php
Anyway, I will check your contributions.
Thank you for your time.