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

fix(logger): let empty entries inherit parent indentation level #302

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

eysi09
Copy link
Collaborator

@eysi09 eysi09 commented Sep 25, 2018

With this change, empty log entries inherit their parent's indentation level. An alternative would be to set the indentation level to zero so that all empty entries—including nested ones—get aligned with the root nodes. I could swing either way (it's a one liner fix), but the former feels a bit more consistent.

So currently, this:

const root = garden.log.info("root")
const empty = root.info()
empty.setState("same level as root")
const deep = empty.info("deep")
const deepEmpty = deep.info()
deepEmpty.setState("same level as deep")

prints this:

root
same level as root
    deep
    same level a deep

@eysi09 eysi09 changed the title fix(logger): let empty entries inherit parent indentation leve fix(logger): let empty entries inherit parent indentation level Sep 25, 2018
@edvald edvald merged commit 5168c0a into master Sep 25, 2018
@edvald edvald deleted the empty-log-entries branch September 25, 2018 13:23
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

Successfully merging this pull request may close these issues.

2 participants