Skip to content

Commit 382477e

Browse files
committed
Update logging
1 parent 2d0a7ac commit 382477e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

afw.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def cli():
2626
@cli.command()
2727
@click.argument("workflow_path")
2828
def build(workflow_path: str):
29+
logging.basicConfig(level=logging.INFO)
30+
2931
workflow_path = Path(".").joinpath(workflow_path)
3032

3133
# load package info
@@ -42,7 +44,7 @@ def build(workflow_path: str):
4244
)
4345

4446
# build package - depend
45-
print("Prepare...")
47+
logging.info("Prepare...")
4648
requirements: list[str] = list()
4749
with open(workflow_path.joinpath("requirements.txt")) as f:
4850
for line in f.readlines():
@@ -64,17 +66,17 @@ def build(workflow_path: str):
6466
# for filename in FILENAME_LIST:
6567
# package_file.write(filename)
6668

67-
print("Add 3rd depends files...")
69+
logging.info("Add 3rd depends files...")
6870
build_path_str_length = len(str(build_path)) + 1
6971
for file in build_path.rglob("*"):
7072
if file.suffix == ".pyc" or file.name == "__pycache__":
7173
continue
7274

7375
arc_name = str(file)[build_path_str_length:]
74-
print(arc_name)
76+
logging.info(arc_name)
7577
package_file.write(file, arcname=arc_name)
7678

77-
print("Add workflow files...")
79+
logging.info("Add workflow files...")
7880
workflow_files: list[str] = AFW_WORKFLOW_BASIC_FILES
7981
icon_file = package_info.get("icon")
8082
if icon_file:
@@ -87,7 +89,8 @@ def build(workflow_path: str):
8789
package_file.write(file)
8890

8991
package_file.close()
90-
print(f"Create Alfred workflow[{package_path}] finished.")
92+
93+
logging.info(f"Create Alfred workflow[{package_path}] finished.")
9194

9295

9396
def afw_entry(workflow):

0 commit comments

Comments
 (0)