Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger #82

Open
ctjhoa opened this issue Jun 10, 2020 · 2 comments
Open

Add logger #82

ctjhoa opened this issue Jun 10, 2020 · 2 comments

Comments

@ctjhoa
Copy link

ctjhoa commented Jun 10, 2020

Newly generate codemod doesn't come with logger.
I dug into ember-codemods, looking for a standard way to log errors and warnings.

I found several ways to achieve it:

  1. Use pure nodejs
    https://github.com/ember-codemods/ember-data-codemod/blob/master/transforms/globals-to-ember-data-imports/index.js#L6

  2. Use winston
    https://github.com/ember-codemods/ember-angle-brackets-codemod/blob/master/lib/logger.js

  3. Use console
    https://github.com/ember-codemods/ember-component-template-colocation-migrator/blob/master/lib/utils/file.js#L8

  4. Use console with SilentError pattern
    ember-codemods/tagless-ember-components-codemod@491cfa2

What's your recommendation on this? Do you think a default logger should be generate too?

@rwjblue
Copy link
Owner

rwjblue commented Jun 29, 2020

Ya, I was actually just chatting a bit with @mmun on this the other day. Hopefully he has a chance to chime in...

@mmun
Copy link

mmun commented Jun 30, 2020

What I was thinking about is a way to collect data across multiple files and do some global linting/reporting based on that. That might be more than what most people are wanting here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants