Skip to content

Improvements to logging #63

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

Closed
1 task
dhruvkb opened this issue Aug 14, 2020 · 24 comments · Fixed by #143
Closed
1 task

Improvements to logging #63

dhruvkb opened this issue Aug 14, 2020 · 24 comments · Fixed by #143
Assignees
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing feature help wanted Open to participation from the community 💪 skill: python Requires proficiency in 'Python' 🏷 status: label work required Needs proper labelling before it can be worked on

Comments

@dhruvkb
Copy link
Member

dhruvkb commented Aug 14, 2020

Problem

Currently the workflow scripts, notably those in push_data_to_ccos/ and sync_community_team/ are riddled with print() statements serving the function of logging. While this is a perfectly workable solution, it is by no means elegant. Also the process of manually indenting the messages in the print() statements is messy and error-prone and makes for hard to comprehend logs.

Alternatives

Python comes with a nifty logging module that should be used instead. Sprinkle some ANSI colouring and 🤯 .

Implementation

  • I would be interested in implementing this feature.
@dhruvkb
Copy link
Member Author

dhruvkb commented Aug 15, 2020

Just adding resources that might help anyone taking a shot at this issue.

  • The Python library curses seems like a good solution to our indentation problem.
  • Docker Compose wrote a class dedicated to handle log writes from parallel processes which involved writing to past lines.
  • There are some really cool ANSI codes that, if supported, allow you to move your cursor on the window field.

@dhruvkb dhruvkb added help wanted Open to participation from the community ✨ goal: improvement Improvement to an existing feature and removed help wanted labels Sep 3, 2020
@dhruvkb
Copy link
Member Author

dhruvkb commented Sep 5, 2020

You can also use (and modify) the logging system added as a part of #72.

@dhruvkb dhruvkb added the 💪 skill: python Requires proficiency in 'Python' label Sep 5, 2020
@avats-dev
Copy link

Taking up this one @dhruvkb! Might take some time for me to complete this.

@avats-dev
Copy link

Also, I'm unable to open issues in this repo. Can you explain why?

@dhruvkb
Copy link
Member Author

dhruvkb commented Sep 6, 2020

@avats-dev creativecommons/.github#17 both explains and fixes the issue.

@dhruvkb dhruvkb added the 🕹 aspect: interface Concerns end-users' experience with the software label Sep 6, 2020
@avats-dev
Copy link

avats-dev commented Sep 17, 2020

@dhruvkb Sorry, I was out of station for sometime, so I am starting now on this.

I'm thinking of using log and setting up a common log.py and utils.py that can be used by all the other scripts in repo. This would also refactor code and help resolving #60.
What do you think?

@dhruvkb
Copy link
Member Author

dhruvkb commented Sep 18, 2020

Sounds good, but you need to ensure that all the scripts can run independently of each other.

@dhruvkb
Copy link
Member Author

dhruvkb commented Sep 29, 2020

@avats-dev some new developments in this area that might be relevant:

@avats-dev
Copy link

Wow, that is good! thanks @dhruvkb for the update, I'll keep that in mind. 👍

@ghost
Copy link

ghost commented Nov 17, 2020

@dhruvkb would colorlog be a good idea for this?

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 17, 2020

@sukhdeepg it might be, it's hard to say without a demo. GitHub Actions now also supports colors for error and warning formatting so that might be a simpler and more native solution.

@ghost
Copy link

ghost commented Nov 18, 2020

@dhruvkb understood 👍

@rajdesai24
Copy link
Contributor

I am taking this @dhruvkb

@rajdesai24
Copy link
Contributor

@dhruvkb I have finished up the logging part for push_data_to_ccos and I guess we can have a demo for that if all goes well we can implement it in all other places.

@dhruvkb
Copy link
Member Author

dhruvkb commented Nov 28, 2020

@rajdesai24 please create a PR so that we can review it.

@cc-open-source-bot cc-open-source-bot added the 🏷 status: label work required Needs proper labelling before it can be worked on label Dec 2, 2020
@rajdesai24
Copy link
Contributor

@dhruvkb I have made a pull request for the issue, please review it and let me know if there is some blocker.

@rajdesai24
Copy link
Contributor

@rajdesai24 please create a PR so that we can review it.

@dhruvkb I'll be creating a new pr with the resolved issues and proper logging everywhere please review it and do the necessary

@dravadhis
Copy link

@rajdesai24 are you working on this? If not can I take this up?

@rajdesai24
Copy link
Contributor

Yes, it's done my pr is left for review but you can still talk to dhruvkb he'll guide you the best

@dravadhis
Copy link

No worries. I'll look for some other issues.

@rajdesai24
Copy link
Contributor

@dhruvkb I will be opening a new PR with the same changes as my last PR got closed as it was a little off track with the repo as guided by @TimidRobot. Should I go ahead and make a new one?

@Cronus1007
Copy link
Member

@rajdesai24 You can go ahead.

@rajdesai24
Copy link
Contributor

Created new PR

@TimidRobot TimidRobot assigned TimidRobot and unassigned avats-dev Apr 12, 2022
@TimidRobot TimidRobot linked a pull request Apr 12, 2022 that will close this issue
7 tasks
@TimidRobot
Copy link
Member

Fixed by #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹 aspect: interface Concerns end-users' experience with the software ✨ goal: improvement Improvement to an existing feature help wanted Open to participation from the community 💪 skill: python Requires proficiency in 'Python' 🏷 status: label work required Needs proper labelling before it can be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants