kwelch / babel-plugin-captains-log

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

Need source file names #3

Closed mvolkmann closed 7 years ago

mvolkmann commented 7 years ago

This looks like a great start! Thanks for creating this! One more feature would convince me to use it ... pretending source file names.

kwelch commented 7 years ago

I completely agree. This should be pretty simple to put together. I am working on adjusting the scope string.

Would you agree that this template would be helpful: {filename}({line}:{column}) - {scope}

I think this should also have a separate flag or the scope flag should be expanded.

mvolkmann commented 7 years ago

I'm not sure the column is useful. I can see some people wanting the line number, but it might be good to make that optional. I'm mostly interested in the file name and function name.

kwelch commented 7 years ago

Currently I attempt to walk up the path, do you find that helpful? Or would it be enough to just go up to the first function.

mvolkmann commented 7 years ago

For me the first function is enough, but I imagine others would like more of the path.

kwelch commented 7 years ago

Thanks I appreciate your view. I bounced around on these ideas a few times and didn't know where to land.

mvolkmann commented 7 years ago

I'm really looking forward to using this!

kwelch commented 7 years ago

Added a PR for this. It is minimal, if you could review the tests to see how it transform that would be helpful. I will add docs later and merge.

kwelch commented 7 years ago

Closing with the merge of #5. 🎉