View output of previous commands - shell

Is there a way to view all the past logs such as API responses, warnings etc that displayed on the shell after closing it? Typing "history" will just show the history of commands. I need to see the past logs / everything else

No, that's not possible. By default, only the commands are logged.

Related

Prevent browser-sync log data in firebug console

I often use gulp and its plugin browser-sync.
Every time i open firebug console tab, i see its full of logs like :
GET http://localhost:3000/browser-sync/socket.io/?EIO=3&transport=polling&t=1457523519574-0 200 OK ۳ms browser...11.1.js (line 2)
I can use clear button but logs are interminable! they will appear twice.is there any persistent way to ride of these(browser-sync) logs?
Yes, there is. Just uncheck the option Show XMLHttpRequests within the Console panel's options menu.
Though note that this will disable the logging for all XMLHttpRequests, (aka AJAX requests).
There is currently no way to filter out specific logs. There are already two enhancements requests for that: issue 4507 and issue 6835 targetting Firebug 2, but as Firebug 3 will be built upon the DevTools, it is probably wiser to follow the DevTools related requests. The closest one to your issue is bug 905978 to filter out messages for blackboxed sources, but I've also filed bug 1102797 some time ago for allowing to blackbox sources from within the Console panel and bug 1255311 right now for ignoring specific log messages.

How to debug a Firefox search engine plugin?

I am writing a search engine plugin for Firefox.
I want to implement search suggestions, so I want my plugin to send requests to my server to get them.
In order to debug this functionality I need to see what requests have been sent and what response is returned.
I noticed that Firebug does not log this info. So I need something else. How can I do that?
The add-on LiveHTTPHeaders works.
https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/
Also try Ctrl+Shift+Q and look at the Network tab, that will probably work, too, although I haven't used that before.
Tools-->Web Developer--->Browser Console(Ctrl+Shift+J)
And in the tab of Net, check "Log Request and Response Bodies"

Disable Heroku Router Logs

I've written a Heroku app, that's a very simple API. A number of GET requests are made to it with sensitive information amongst their parameters. It would be preferable to have Heroku not log this sensitive information.
Is there any way to have Heroku not log requests or better yet, truncate the path so it contains no parameters?
I don't think there's a way to do it. The usual answer is to POST the sensitive information rather than use GET, but I'm guessing that's not an option for you.
Using heroku logs --source app will only show the logs of you app.
heroku logging
I had the same issue and as I didn't find a solution.
So I'll let you know my workaround for PHP Laravel 6.3 application on Heroku.
Activate Papertrail addon (free with "Wayne" plan)
Show web app output
Filter for "application" (and environment, in my case "staging"
"Save search" -> Replace existing search -> "web app output"
Hope this helps others.
In case anyone is still searching for this. Papertrail now supports Log filters.
Just go to Papertrail > Dashboard > lower right corner > Filter logs.
You can use a regular expression like this:
heroku\/router
and papertrail will ignore all heroku/router logs. This however does not prevent Heroku from emitting those logs altogether, you can still see live heroku/router logs by going to your app's dashboard and clicking "More"> "View Logs.
It can significantly reduce costs though.

clear up GM_log from error console

Is there a way to clear up GM_log messages from error console from userscripts on a certain event?
I don't want to clear up manually. On trigger of certain event, want to clear up the old log from the error console and show up the new log.
You cannot clear the error console. If you could, evil websites could clear it too and erase the record of their misdeeds.
You should no longer use GM_Log() anyway. Use Firebug and the excellent console logging functions it provides.
Then you can use console.clear().
Note, to avoid conflicts with Firefox's newish console functions, and to ensure that the output appears in Firebug's console, you may need to prefix the calls with unsafeWindow.
So your script could do something like this:
unsafeWindow.console.clear ();
unsafeWindow.console.time ('ScriptRun');
unsafeWindow.console.log ("Script start." );
unsafeWindow.console.timeEnd ('ScriptRun');
Which would look like this in the Firebug console:
-- with all the preceding cruft erased. (Anything the webpage does after the clear() call will still appear though.)

Why does this PHP script show errors, but not echo etc.?

I have this PHP script http://snippi.com/s/kx0k48g (too long for here, but put it in Snippi). It is built to run by an AJAX GET request. When I supply all the right GET parameters the script seems to run fine (no errors), but it won't echo or anthing else that the script does (inserting in the Database). It only shows something (errors) when I do not supply the right GET parameters. Any idea what could be wrong? It is extremely hard to debug, because it won't tell me that anything is wrong, but refuses to do the right thing.
Any help would be appreciated. Thanks!
Try using trigger_error() in PHP for debugging instead of echo. Then you don't have to worry about output buffering, etc.
trigger_error("I have reached checkpoint 1!", E_USER_WARNING);
Put a tail -f on your error log for your web server and see how far you get.
http://php.net/manual/en/function.trigger-error.php

Resources