DedSecInside / TorBot

Dark Web OSINT Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move log level from environment variable to CLI flag

KingAkeem opened this issue · comments

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.

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

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

@dargudear Any updates on this one?

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

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

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

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.

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

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

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

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 😅

@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.