Git Product home page Git Product logo

quick-console-log's Introduction

Quick console log

Support language

  • C# for Unity
  • Dart
  • Java
  • Javascript
  • Javascript React
  • Python
  • Typescript
  • Typescript react

Features

This extension prints a log using the text of your cursor or the selected sentence.

In Python, print is used instead of console.log.


Demo and description

Hot key

ctrl+alt+l: Log output at the bottom of the sentence. line.gif

ctrl+alt+u: Log output at the up of the sentence. line.gif

ctrl+alt+v: Log output at the current by clipboard.

Snippet

cl: Log output by clipboard. snippet.gif

dl: Log output, only Unity c#

Properties

key type default description
logMessagePrefix string ๐Ÿ“ข The prefix of the log message.
addSemicolonInTheEnd boolean true Whether to add or not a semicolon in the end of the log message.
quote enum " Double quotes, single quotes or back tick
useAutoVariableLabel boolean true Use auto variable label
useFullPath boolean false Use full path of file name.
includeFileName boolean true Whether to include the file name of the log message.
includeLineNumber boolean true Whether to include the line number of the log message.
unityProject boolean true Output Debug.Log() instead of Console.WriteLine(), only c# file

quick-console-log's People

Contributors

gyuha avatar kotsuha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kotsuha

quick-console-log's Issues

Separate `includeFileNameAndLineNum` into two options

I feel like includeFileNameAndLineNum can be separated into two options :)

Sometimes I insert a bunch of logs here and there when I'm debugging. The "line number" quickly becomes wrong.

289    private static FooDefinition GetFooData(string fooName)
290    {
291        TextAsset fooDataFile = Resources.Load<TextAsset>("FooData/" + fooName);
292        string rawFooData = fooDataFile.text;
293        Debug.Log("๐Ÿ“ข[FooManager.cs:293]: " + rawFooData);
294        //Destroy(fooDataFile);
295        var fooData = JsonConvert.DeserializeObject<FooDefinition>(rawFooData);
296        Debug.Log("๐Ÿ“ข[FooManager.cs:295]: " + fooData);
297        return fooData;
298    }

Insert [FooManager.cs:295] first and then insert [FooManager.cs:293]. The [FooManager.cs:295] line number becomes wrong. The file name is still helpful.

Possible expanding to Vue script tag

I've tested your plugin and it's one of the fastest and most accurately console.log tool.

In there any chance to make it work with Vue files?

Apparently the extension works fine with Vue structure file format. If I replace the extension .vue to .js, it simply works.

QCL Current line cursor

QCL Current Line is a little different than QCL Up, or QCL Down. After a QCL Up or Down the cursor does and should remain where it was. After a QCL Current Line, it would make sense to position the cursor selecting the original text.

If text was not a string have it select everything

myvar

becomes

console.log("๐Ÿ“ข[index.js:12]: ", myvar);

where the selection is the black part

else If text was a string leave it selecting everything within the quotes.

"something happended"

console.log("๐Ÿ“ข[index.js:12]: ", "myvar");

where the selection is the black part.

QCL Log Current accessible by hotkey also

Currently Log output by clipboard is triggered by snippit "cl"

I would like it also accessible by hotkey. Maybe use โŒƒ โŒฅ v. Sort of makes sense from a pseudo paste from clipboard perspective.

QCL Enhancement - Empty Console Log

Assume no text selection and cursor not overlying word

quick console log would insert a blank console log like:

console.log("๐Ÿ“ข [index.js:10]: ", "");

Now how to implement this? This would seemingly fit nicely with "Log Current". I would also suggest that it fits for "Log Down" and "Log Up" as well although without end cursor repositioning. By applying to all (Up, down, current) this functionality would benefit everyone as I expect that most users gravitate to a single option (I suspect "Log Down")

QCL Setting option to include variable labels

If this option were enabled, and example would be

myvar

becomes

console.log("๐Ÿ“ข[index.js:12]: myvar: ", myvar);

or if you prefer

console.log("๐Ÿ“ข[index.js:12]: ", "myvar", myvar);

Thinking about it is should only work this way if the typeof were not a string, so

"something happened here"

should still be

console.log("๐Ÿ“ข[index.js:12]: ", "something happened here");

QCL Log Current - change cursor position at end

The ending cursor position after triggering quick console log current is the end of the console log statement. It might be more useful to leave it selecting the last argument

index

becomes

console.log(๐Ÿ“ข[useToTodo.ts:12]: , index);

with index highlighted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.