PHP server messages

47 рдмрд╛рд░ рджреЗрдЦрд╛ рдЧрдпрд╛
рдирд╣реАрдВ рдкрдврд╝реЗ рдЧрдП рдкрд╣рд▓реЗ рдореИрд╕реЗрдЬ рдкрд░ рдЬрд╛рдПрдВ

Pedro Bastos das Neves

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
6 рдорд╛рд░реНрдЪ 2017, 5:48:20 am6/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ Firebug
How to log to the console php server messages? And witch server library to use?
I'm asking this because Firephp is not working.
The crhome logger is the only choice? This one doesn't work well too?
Thanks,

Sebastian Zartner

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
6 рдорд╛рд░реНрдЪ 2017, 6:40:55 am6/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ Firebug
Yes, Chrome Logger is what you need to use.
If you have issues integrating it into your PHP code, you should open an issue for Chrome Logger. If you integrated it into your PHP code, but the output is not shown or incorrectly shown in the DevTools console, you should first read the related documentation. If you then still experience problems, ask on IRC, Twitter or Stack Overflow or file a bug against the DevTools.

Sebastian

Erik Krause

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
6 рдорд╛рд░реНрдЪ 2017, 7:44:44 am6/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ fir...@googlegroups.com
Am 04.03.2017 um 10:21 schrieb Pedro Bastos das Neves:
> The crhome logger is the only choice? This one doesn't work well too?

I've modified chromePHP such that it is a bit more FirePHP-like:
https://github.com/ErikKrause/chromephp

--
Erik Krause

Lawrence San

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
6 рдорд╛рд░реНрдЪ 2017, 11:03:58 am6/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ fir...@googlegroups.com
I don't understand why people are
тАЛnow тАЛ
saying you
тАЛ_тАЛ
have
тАЛ_тАЛ
to use Chrome Logger
тАЛ to log PHP from Firefox.тАЛ That's not true
. In this discussion list,
тАЛsee
┬аthe thread entitled "replacement for firephp (devtools)"
тАЛ from late September to early December 2016 (sorry, I don't know how to link to it). In that thread, Erik, myself, and a couple of others talked about other ways of getting PHP logging in Firefox, without FirePHP. (Although FirePHP was certainly better and I wish it would come back to Firefox.)

Here's the method I use, and it still works:

Set up a separate PHP file in your standard PHP path location. This is originally based on someone else's script (unfortunately I don't know whose, so I can't credit him here), but I made some modifications to simplify it. I call the file PhpToConsole.php. I've removed some of the devel comments below; its functional contents are:
тАЛ
<?php

function phpToConsole( $data ) {

┬а ┬а ob_start();

┬а ┬а $output = 'console.log(' . json_encode( $data ) . ');';
┬а ┬а $output ┬а= sprintf( '<script>%s</script>', $output );

// TOGGLE: Temporarily comment out just the echo line below, if desired to clear the Console for other (like JS) calls:
┬а ┬а echo $output;

}

?>


тАЛI call it (i.e. log something to the ConsolтАЛe) simply like this:

┬а ┬а ┬аphpToConsole( "[PHP] My log message including $myVariable goes here." );

I keep the phpToConsole script in a separate file, and pull it in with a┬аrequire_once in every other PHP file, but the script is so short it could simply be placed at the top of every file that needs it.

Almost featureless, but it's dead simple and works for now.

- Lawrence

Sebastian Zartner

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
7 рдорд╛рд░реНрдЪ 2017, 4:31:33 am7/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ Firebug
Please forgive me my forgetfullness and ignorance, Lawrence and Erik! Indeed, you provide good alternatives for Chrome Logger.

After all, server-side logging works through HTTP headers, so if somebody wants to, he or she can implement their own tool to create those headers, or use the simple solution to make console.log() calls outlined by Lawrence.

Sebastian

Erik Krause

рдирд╣реАрдВ рдкрдврд╝реА рдЧрдИ,
7 рдорд╛рд░реНрдЪ 2017, 11:04:59 am7/3/17
рдИрдореЗрд▓ рдкрд╛рдиреЗ рд╡рд╛рд▓рд╛ fir...@googlegroups.com
Am 06.03.2017 um 17:03 schrieb Lawrence San:
> I don't understand why people are тАЛnow тАЛ saying you тАЛ_haveтАЛ_тАЛ to
> use Chrome Logger тАЛ to log PHP from Firefox.

Sorry, I was not clear enough: My version of chromePHP acts as a drop-in
replacement for FirePHP (at least the part I regularly use). You can
re-use all FirePHP log, warn, info, error, etc. calls.

--
Erik Krause
http://www.erik-krause.de
рд╕рднреА рдкреНрд░рд╖рдХреЛрдВ рдХреЛ рдЙрддреНрддрд░ рджреЗрдВ
рд▓реЗрдЦрдХ рдХреЛ рдЙрддреНрддрд░ рджреЗрдВ
рдЖрдЧреЗ рднреЗрдЬреЗрдВ
0 рдирдпрд╛ рдореИрд╕реЗрдЬ