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.

Logger doesn't seem to work with errors

See original GitHub issue

I’m not sure if this is a new thing because I thought it worked before, but it seems whenever I try and log/warn/error an error object it just logs an empty object. My config is the same as you have in the readme, other than a different api url. Here’s what happens when I try and log various things in the js console.

this.logger.log({msg: 'here we go', custom: 'yup'})

gets logged as

2018-03-21T00:37:34.131Z [LOG] {
  "msg": "here we go",
  "custom": "yup"
}

However if I do

error = new Error('Here is my error message');
this.logger.log(error);

I get

2018-03-21T00:40:54.334Z [LOG] {}

Which I imagine is because that is the result of JSON.stringify(error). Is this a known issue? Are there plans to fix it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
dbfannincommented, Mar 22, 2018

@jensengar, see comment above. version 2.0.4

0reactions
dbfannincommented, Mar 22, 2018

I had an issue with the first time I published to 2.0.3, so I had to unpublish and bump the revision.

Read more comments on GitHub >

github_iconTop Results From Across the Web

logging.info doesn't show up on console but warn and error do
The root logger always defaults to WARNING level. Try calling logging.getLogger().setLevel(logging.INFO). and you should be fine.
Read more >
8 Python Logging Pitfalls to Avoid - Papertrail
The first pitfall on our list consists of using a too basic or simplistic approach to logging. In Python, this amounts to writing...
Read more >
Log exception does not appear in Orchestrator
Hello, I have created a Library in order to log Try Catch exceptions across my Project. The library has an in parameter of...
Read more >
Retrieving Error Messages - Omeka Classic User Manual
If Omeka Classic doesn't seem to be behaving correctly, for whatever reason, there are steps you can take to get more descriptive error...
Read more >
A Step-by-Step Guide to Python Logging - Pylenin
Something does not look right") logging.error("You have encountered an error") ... Notice how logs with debug and info didn't get logged.
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