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

Move log level from environment variable to CLI flag #292

Closed
KingAkeem opened this issue Sep 9, 2023 · 12 comments
Closed

Move log level from environment variable to CLI flag #292

KingAkeem opened this issue Sep 9, 2023 · 12 comments

Comments

@KingAkeem
Copy link
Member

KingAkeem commented Sep 9, 2023

Is your feature request related to a problem? Please describe.
Currently, the logging level is determined by a setting in the .env file.

Where the value is set within the .env file

TorBot/.env

Line 4 in 289429f

export LOG_LEVEL="info" # OPTIONS - info, debug, fatal

Where the value is read from the .env file

def get_log_level() -> int:
log_level_str = os.getenv('LOG_LEVEL')
if log_level_str:
log_level_str = log_level_str.lower()
mapping = logging.getLevelNamesMapping()
if log_level_str in mapping:
return mapping[log_level_str]
return logging.INFO

Describe the solution you'd like
Instead of reading the value from the .env file, it can be read from the CLI flag using a verbose flag -v.

@dargudear
Copy link

dargudear commented Sep 10, 2023

I would like to work on this issue. Can you please assign it to me?

@PSNAppz
Copy link
Member

PSNAppz commented Sep 10, 2023

@dargudear Great!. I'll assign it to you. Raise a PR to the dev branch once you're done.

@PSNAppz
Copy link
Member

PSNAppz commented Sep 28, 2023

@dargudear Any updates on this one?

@vedant-z
Copy link
Contributor

vedant-z commented Oct 4, 2023

@PSNAppz @KingAkeem I have come up with some initial solution for this. If you allow me then I will make PR for this issue.

@KingAkeem
Copy link
Member Author

@vedant-z It's all yours, we haven't heard anything back from @dargudear.

@KingAkeem KingAkeem assigned vedant-z and unassigned dargudear Oct 5, 2023
@KingAkeem
Copy link
Member Author

I've assigned the issue to you @vedant-z, thank you for the contribution in advance.

@dark-developer15
Copy link

dark-developer15 commented Oct 5, 2023

Hey there @KingAkeem, I have made the changes, as mentioned, and am trying to test it. If I may, I would like to contribute to this issue.

@KingAkeem
Copy link
Member Author

@dark-developer15 A pull request has already been created by @vedant-z

@dark-developer15
Copy link

Yes @KingAkeem, I saw it, I was just trying to solve it and was successful, that's why I asked.

@KingAkeem
Copy link
Member Author

@dark-developer15 you can push a PR as well, I'll merge the first correct one.

@dark-developer15
Copy link

Okk sure, I'll do it. But if @vedant-z PR is good to go then, his PR should get merged, Hacktoberfest is about learning and he is doing his best 😅

@PSNAppz
Copy link
Member

PSNAppz commented Oct 7, 2023

@dark-developer15 Why don't you look into #270?

You can also suggest new features and we'll look into it. Since Hacktoberfest23 is going on, we'll be actively reviewing the issues/features requests.

@vedant-z vedant-z mentioned this issue Oct 9, 2023
@PSNAppz PSNAppz added this to the TorBot v4 milestone Oct 9, 2023
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

5 participants