Skip to content

Conversation

@skshetry
Copy link
Collaborator

@skshetry skshetry commented Feb 14, 2020

  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • πŸ“– Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Fixes #3282

Screenshot from 2020-02-14 17-14-23

@skshetry skshetry requested review from Suor, efiop and pared February 14, 2020 11:27
@skshetry skshetry self-assigned this Feb 14, 2020
@skshetry skshetry requested a review from a user February 14, 2020 11:28
Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!


return "{color}{date}{nc} ".format(
color=colorama.Fore.GREEN,
date=super().formatTime(record, datefmt),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default output looks like 2020-02-14 17:13:44,627. I did not really tried fighting with the format and went with default one. Plus, this supports setting datefmt from dictConfig.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need a different format later on, we can just change in the dictConfig anyway. πŸ™‚

Copy link
Contributor

@efiop efiop Feb 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, a bit long for my taste. We could shorten stuff like year (cut it off or shorten to "20"), but it won't make a big deal. I'm ok with leaving it as is. πŸ‘

Also, really like the implementation πŸ˜‰

@efiop efiop merged commit 17c7b72 into treeverse:master Feb 14, 2020
@skshetry skshetry deleted the logging-datetime branch February 14, 2020 11:58
Copy link
Contributor

@pared pared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge LGTM.



@pytest.fixture()
def dt(mocker):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

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.

loggers: include timestamp to see how long operation takes

3 participants