Skip to content

Commit 37ae722

Browse files
committed
feat: loggerじゃないとログが出ないかも(あとテスト通らない)
1 parent 80f8a2d commit 37ae722

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

atcodertools/executils/run_command.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import subprocess
22
import locale
3+
from logging import getLogger
4+
5+
logger = getLogger(__name__)
36

47

58
def run_command(exec_cmd: str, current_working_dir: str) -> str:
9+
logger.info("Running command: " + exec_cmd)
610
proc = subprocess.run(exec_cmd,
711
shell=True,
812
stdout=subprocess.PIPE,

atcodertools/tools/codegen.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def main(prog, args, output_file=sys.stdout):
179179
else:
180180
logger.info("Downloading data without login.")
181181

182+
logger.info("hello i am codegen and current directory is " + os.getcwd())
182183
generate_code(client,
183184
args.url,
184185
config,

atcodertools/tools/setter.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def main(prog, args) -> None:
5151
args = parser.parse_args(args)
5252

5353
old_metadata = Metadata.load_from(os.path.join(args.dir, "metadata.json"))
54+
logger.info("current directory: " + args.dir)
5455

5556
# Use the old metadata as base metadata.
5657
output_metadata = Metadata.load_from(
@@ -72,7 +73,7 @@ def main(prog, args) -> None:
7273
elif new_metadata_judge_type == JudgeType.Decimal.value:
7374
output_metadata.judge_method = DecimalJudge()
7475
if args.error_value is None:
75-
logger.warn(
76+
logger.warning(
7677
"Error-value is not specified. DEFAULT_EPS is set")
7778
output_metadata.judge_method.diff = DEFAULT_EPS
7879
else:
@@ -94,11 +95,11 @@ def main(prog, args) -> None:
9495
a = ["--lang", output_metadata.lang.name, url]
9596
if args.without_login:
9697
a.append("--without-login")
97-
print(f"Generating {output_metadata.lang.name} code...")
98-
print(f"{main_code_filename=}")
99-
print(f"{output_metadata.problem.problem_id=}")
100-
print(f"{output_metadata.problem.contest.contest_id=}")
101-
print(f"{output_metadata.problem.alphabet=}")
98+
logger.info(f"Generating {output_metadata.lang.name} code...")
99+
logger.info(f"{main_code_filename=}")
100+
logger.info(f"{output_metadata.problem.problem_id=}")
101+
logger.info(f"{output_metadata.problem.contest.contest_id=}")
102+
logger.info(f"{output_metadata.problem.alphabet=}")
102103
# alphabetの空のファイルを作成
103104
open(os.path.join(args.dir, output_metadata.problem.alphabet), 'w').close()
104105

0 commit comments

Comments
 (0)