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.

Question: Logging renderer to file and devTools - but not to terminal

See original GitHub issue

I am using electron log in my electron application. First of all, thanks for this project. My application supports a commandline-parameter (--verbose) for optional enabling verbose mode.

The idea is:

  • If the application is started with --verbose from a terminal - the terminal AND the devtools should both show all the logging output from my renderer process.
  • If the application is started without --verbose it should just write the renderer logging to the DevTools but NOT to the terminal

Right now i tried reaching this using log.transports.console.level. If my app is started using --verbose i set log.transports.console.level = true, otherwise to log.transports.console.level = false.

But this effects both:

  • logging to terminal
  • logging to devtools

Is there an option to control devtools vs terminal output?

Best regards

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
megahertzcommented, Apr 16, 2020

My question is: Does electron-log support a mode where the logging appears in DevTools BUT NOT appear in Terminal

In this case, you can disable console transport only in main process.

0reactions
yafpcommented, Apr 18, 2020

Does electron-log support a mode where the logging appears in DevTools BUT NOT appear in Terminal

In this case, you can disable console transport only in main process.

that part wasn’t obvious for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using console.log() in Electron app - Stack Overflow
When you call the console. log() from main process of electron app, it will output to the terminal window from where you just...
Read more >
How to log errors in main and render process to a file? #731
All I want is to generate a log file, which should have output of not just Console.error() but also Console.log() , Console.info() ....
Read more >
How to enable logging - The Chromium Projects
To enable logging, launch Chrome with these command line flags: ... If you are debugging renderer startup on Windows, we recommend you enable...
Read more >
Troubleshooting | Cypress Documentation
Open Cypress via cypress open · Go to Developer Tools -> View App Data · This will take you to the directory in...
Read more >
Log messages in the Console - Chrome Developers
Focus the demo and then press Control + Shift + J or Command + Option + J (Mac) to open DevTools. By default...
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