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 name/line-numbers no longer show accurately

See original GitHub issue

I recently upgraded my app to Angular 6 and ngx-logger 3.0.0-rc1.

Unfortunately the logger no longer shows the file name/line number of the log - instead it shows main.js:<line num>.

Previous behavior

2018-06-11T19:06:58.864Z DEBUG [demo.component.ts:155] loading api       ngx-logger.js:386

Current behavior

2018-06-11T19:06:58.864Z DEBUG [main.js:2164] loading api       ngx-logger.js:386

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:43 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
tomanovycommented, Nov 24, 2019

I just tested on Angular 9.0.0-rc.3 as adviced here https://stackoverflow.com/a/56669585/1392277 but still getting main.js in logs So on 9.0 only works with --evalSourceMap=true for now.

Anyone any ideas please? Or someone more lucky on 9.0?

Looks like I found a solution to make this work

  loggerConfig: {
    level: environment.production ? NgxLoggerLevel.WARN : NgxLoggerLevel.DEBUG,
    // serverLoggingUrl: '/api/logs',
    // serverLogLevel: NgxLoggerLevel.OFF,
    enableSourceMaps: true, // <-- THIS IS REQUIRED, to make "line-numbers" work in SourceMap Object defition (without evalSourceMap)
    disableConsoleLogging: environment.production
  }
3reactions
dbfannincommented, Jun 22, 2018

@JavierFuentes, If you’re going to comment, please try to stay constructive and positive. There is no need for negative comments. The people that support this project are sacrificing time and energy to provide you with a service at no cost to you, and they get no benefit from it themselves. Please be respectful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show filename and line number in grep output - Stack Overflow
When I don't need the line numbers I often use -f1 (just the filename and path), and then pipe the output to uniq...
Read more >
Show line number when search a single file - ack - Super User
This issue was raised as a bug for ack Output line numbers of matches when acking a single file #244 with the following...
Read more >
How To Show or Hide Line Numbers In vi / vim Text Editor
In this tutorial, you will learn how to display or hide line numbers in Vim / Vi text editor running on Linux/Unix based...
Read more >
Get-Content (Microsoft.PowerShell.Management)
The Get-Content cmdlet gets the content of the item at the location specified by the path, such as the text in a file...
Read more >
File and line numbers in stack trace - Unity Forum
logMessageReceived handler? Here is an example of a callstack reported by Unity Game Performance, the file/line would normally appear appear ...
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