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

Chained namespace #34

Closed
teukuamru opened this issue Apr 15, 2020 · 1 comment
Closed

Chained namespace #34

teukuamru opened this issue Apr 15, 2020 · 1 comment
Labels

Comments

@teukuamru
Copy link

teukuamru commented Apr 15, 2020

Now:

import roarr from 'roarr'

const log1 = roarr.child({ namespace: 'parent' })
const log2 = log1.child({ namespace: 'first_child' })

log2 will only have namespace: 'first_child'

My expectation: namespace: 'parent:first_child'

@gajus gajus closed this as completed Apr 15, 2020
@gajus
Copy link
Owner

gajus commented Apr 15, 2020

You will need to get the last namespace and append it, i.e.

const log1 = roarr.child({ namespace: 'parent' })
const log2 = log1.child({ namespace: log1.getContext().namespace + ':first_child' })

@gajus gajus added the question label Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants