Overview

Motivation

Statistics

Features

Insert a log message

Comment inserted log messages

Uncomment log messages

Delete log messages

Correct log messages

Settings

Custom Prefix

Custom Suffix

Log Function Type

Log Function Name

Custom delimiter

Custom quote

Use semicolon

Enclosing class

Enclosing function

Include file name and line number

Include file name

Include line num

Wrap log message

Line before log message

Line after log message

Join the Turbo Tribe

30% Off

Subscribe to our newsletter to receive the latest updates, contribute to Turbo's future through surveys, and get an automatic 30% discount on Turbo Pro!

Get Latest Updates

Shape Turbo's Future

30% Off Turbo Pro

Get 30% off • Shape the future • Zero spam

Include file name and line number


The includeFileNameAndLineNum option is a powerful feature that enables you to include the file name and line number of the log message. This can be especially useful when debugging complex codebases, making it easier to trace the origin of specific log messages.


Usage

  1. To modify the Include File Name and Line Number setting:

    Navigate to the settings in VS Code: File → Preferences → Settings (or Code → Preferences → Settings on Mac). Search for "Turbo Console Log" and locate the includeFileNameAndLineNum setting. Switch the toggle to your preferred state.


  2. In your code:

    When enabled, the Turbo Console Log extension will include the file name and line number where the log message is generated in the log output. For instance, if you log a variable within 'myComponent.js' at line 42, the output log message would look like this:

console.log('🚀 ~ file: myComponent.js:42 → SelectedVariable:', SelectedVariable);

The includeFileNameAndLineNum setting can significantly improve your debugging process by making it much easier to locate the source of each log message. This setting is disabled by default.