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.

File/Line numbers?

See original GitHub issue

Currently the line numbers are lost: showing as index.js which points to where the console.log is being called screen shot 2017-09-16 at 3 16 58 pm

This picture shows as vendor.bundle.js because I had --sourcemap=false on.

I did managed to get it to show the “correct” file/line like so: screen shot 2017-09-16 at 3 32 55 pm

But with a major downside, and that is having to make the call with extra ().

// before
this.logger.trace('Hi there');
// after
this.logger.trace('Hi there')();
// changes
this.logger.trace('Hi there') // returns a "formatted console.log function"
// so executing right after would result into showing the right file/line number

To avoid breaking the api, we could set a flag to make it either log directly or return a function.
I can’t think of a “pretty” way of doing this though. Any thoughts?

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
leo6104commented, Sep 19, 2017

@dbfannin 😭 Okay, i try to find another way. Thank you for giving updated information. (Korean references are not up-to-date translations.)

2reactions
dbfannincommented, Apr 12, 2018

filename:line number is now supported in ngx-logger@2.2.0. Hopefully this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there an easy way to tell which line number a file pointer is ...
Is there either a Python built-in or extension to easily track and "tell" what line number a text file pointer is on? Note:...
Read more >
Linux/Unix: Cat Command Display Line Numbers - nixCraft
Explains how to use the cat or nl command to line numbers for your text or program files under Linux or Unix like...
Read more >
Add line numbers to standard output of text files - Ubunlog
Add line numbers to standard output of text files in terminal · 1.1 Using the nl command · 1.2 Using the cat command...
Read more >
How To Add Line Numbers To Text Files On Linux - OSTechNix
The cat command is used to display the contents of a file. If you want to add numbers to the output of a...
Read more >
How to print line numbers of a file in Python? - EasyTweaks.com
Get and print line numbers in a file. Use the Python enumerate function to loop through a text or csv file and then,...
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