GithubHelp home page GithubHelp logo

jaluik / dot-log Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 2.0 113 KB

vscode extension to transfer xxx.log to console.log(xxx) automaticly

Home Page: https://marketplace.visualstudio.com/items?itemName=jaluik.dot-log

License: MIT License

TypeScript 71.70% JavaScript 28.30%
vscode-extension console-log

dot-log's Introduction

Dot Log

A vscode extension that uses .log to log params to the console.

Download

Search Dot Log in vscode extension markets.

Usage

xxx.log => console.log('xxx', xxx)
xxx.clg => console.log('xxx', xxx )
xxx.cwa => console.warn('xxx', xxx)
xxx.cer => console.error('xxx', xxx)
'xxxx'.log => console.log('xxxx')

img

Advanced

You can customize how to log the result by change VS Code Configuration Settings.

    //-------- Dot Log Configuration --------
    "dotLog.config": [
        {
            "trigger": "log",  // it means .log can trigger the completion.
            "description": "quick console.log result", // it  shows completion description when triggered.
            "format": "console.log",  //the result will be format like "console.log('xxx', xxx)"
            "hideName": false,  // if set true, then xxx.log =>  console.(xxx);
            "prefix": "",  // add the  prefix or suffix to console.log(`${prefix}xxx ${suffix}`, xxx)
            "suffix": "",
        }
    ]

for example, if you set config like this, then the result will be xxx.exam ===> example.log("before xxx after", xxx)

 "dotLog.config": [
        {
            "trigger": "exam",
            "description": "show example",
            "format": "example.log",
            "hideName": false,
            "prefix": "before ",
            "suffix": " after",
        }
    ]

the default config is show below, you can copy it and edit it.

    "dotLog.config": [
        {
            "trigger": "log",
            "description": "quick console.log result",
            "format": "console.log",
        },
        {
            "trigger": "clg",
            "description": "quick console.log result",
            "format": "console.log",
        },
        {
            "trigger": "cwa",
            "description": "quick console.warn result",
            "format": "console.warn",
        },
        {
            "trigger": "cer",
            "description": "quick console.err result",
            "format": "console.error",
        }
  ]

MIT © jaluik

dot-log's People

Contributors

jaluik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dot-log's Issues

format能否支持更高自由度的配置

// 例如以下的例子
// format: console.log($1)
test.log => console.log(test)

// format: console.log("$1", $1)
test.log => console.log("test", test)

// format: console.log($1, '$1')
test.log => console.log(test, 'test')

// format: console.log(`%c$1`, "color:red")
test.log => console.log(`%c${test}`, "color:red")

Plain log and Object Log?

Hello, I am hoping you can support these?

const age = 100;
console.log(age); // plain value
console.log({ age }); // wrap in object

I prefer this over using a string before the log.

Is it possible?

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.