question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make console.log to be logged rather then reported ?

See original GitHub issue

Based on #419 I think we might provide this feature - allow redirecting console.log to a file.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:31 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jonahxcommented, Nov 12, 2015

For those looking for a quick and dirty fix for now, putting the following line:

console.log = function() {}

at the top of your spec file will suppress all console.log statements in your code. Alternatively, you could redefine it to do anything else, such as a write to a file.

1reaction
johnjbartoncommented, Apr 12, 2019

https://github.com/karma-runner/karma/blob/master/context/karma.js#L116

console messages in the browser are forwarded to the server via the ‘info’ socket call. That ultimately calls the reporter onBrowserLog function. The reporter does whatever it wants with that result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending console.log without affecting log line - Stack Overflow
This way the console.log call will be made from the correct line, and will be displayed nicely in the console, allowing you to...
Read more >
JavaScript Console.log() Example – How to Print to the ...
Just open the console, Ctrl+Shift+K or F12 , and in the top right you will see a button that says "Switch to multi-line...
Read more >
console.log() - Web APIs - MDN Web Docs
The console.log() method outputs a message to the web console. The message may be a single string (with optional substitution values), ...
Read more >
Please Stop Using console.log() for Debugging — It's Broken
You cannot always trust information reported by console.log() because there is simply no standardized behavior about it. You don't really know what happens ......
Read more >
12 Ways to Improve Your DevTools Console Logging
Open your browser DevTools with F12 , Ctrl | Cmd + Shift + I , or cmd + option + j and jump...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found