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 a utility to identify Roarr location #27

Open
gajus opened this issue Nov 21, 2019 · 0 comments
Open

Add a utility to identify Roarr location #27

gajus opened this issue Nov 21, 2019 · 0 comments

Comments

@gajus
Copy link
Owner

gajus commented Nov 21, 2019

I start pretty much every file with a variation of:

import Logger from '../Logger';

const log = Logger.child({
  namespace: 'createUpstreamHttpClientConfiguration',
});

namespace is most of the time the name of the file.

I am wondering if we could provide a utility to automate this, e.g.

import log from 'roarr.macro';

that would transpile to a version above.

Logger file is usually simply used to add the package name to the context. That could be pulled from package.json or we could resolve location of the Logger.js file to always use as a base.

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

No branches or pull requests

1 participant