Skip to content

Commit de961bb

Browse files
committed
feat: add logger
1 parent 135f655 commit de961bb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
__pycache__/
22
.venv/
33
docs/index.html
4+
lccdocs.log

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
import argparse
44
from importlib.util import module_from_spec, spec_from_file_location
5+
import logging
56
import sys
67

8+
logger = logging.getLogger(__name__)
9+
710
if __name__ == "__main__":
811
parser = argparse.ArgumentParser(description="Lance un script")
912
parser.add_argument(
@@ -17,6 +20,8 @@
1720
module = module_from_spec(spec)
1821
spec.loader.exec_module(module)
1922

23+
logging.basicConfig(filename="lccdocs.log", level=logging.INFO)
24+
2025
if hasattr(module, "main"):
2126
module.main()
2227
else:

0 commit comments

Comments
 (0)