kwelch / babel-plugin-captains-log

Babel plugin that injects helpful details into console statements
MIT License
85 stars 5 forks source link

Inject on Alias on console #4

Open kwelch opened 7 years ago

kwelch commented 7 years ago

Currently the search is looking for member expressions where the object is console, this does not capture scenarios where console is alias or destructured.

const {warn} = console;

```
const c = console;
c.log();
```

It may be beneficial to capture these scenarios. 
kwelch commented 7 years ago

I have started a branch for this, but it could still use some more work I believe.

See feature/aliased

I don't think we need to cover this completely, but would like to have a level of coverage started for this.

kwelch commented 6 years ago

I think this would be also great as an option to allow injection into custom loggers