-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (27 loc) · 747 Bytes
/
main.py
File metadata and controls
43 lines (27 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import argparse
import logging
import os
from dotenv import load_dotenv
from modules.output import print_hello
load_dotenv()
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.INFO)
parser = argparse.ArgumentParser()
parser.add_argument(
"--debug",
action="store_true",
default=False,
help="Enable debug mode and debug logging",
)
args = parser.parse_args()
DEBUG = args.debug
if DEBUG:
logging.getLogger().setLevel(logging.DEBUG)
logging.debug("Debug mode enabled")
def main():
logging.info("Script started")
print_hello()
logging.debug("API_KEY from .env")
logging.debug(os.environ.get("API_KEY"))
logging.info("Script ended")
if __name__ == "__main__":
main()