File tree 1 file changed +11
-2
lines changed
sharktank/sharktank/utils
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 5
5
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
7
7
from typing import Any
8
+ import logging
8
9
import iree .runtime
9
10
import subprocess
10
11
import sys
11
12
from pathlib import Path
12
13
import os
13
14
15
+ logger = logging .getLogger (__name__ )
16
+
14
17
15
18
def _run_program (
16
19
args : tuple [str ],
17
20
):
21
+ logger .info (f"Run command: { args } " )
18
22
process_result = subprocess .run (
19
23
args = args ,
20
24
stdout = subprocess .PIPE ,
@@ -25,10 +29,15 @@ def _run_program(
25
29
err = process_result .stderr .decode ()
26
30
27
31
if process_result .returncode != 0 :
28
- raise RuntimeError (f"stderr:\n { err } \n stdout:\n { out } " )
32
+ raise RuntimeError (
33
+ (
34
+ f"Command { args } \n failed with return code "
35
+ f"{ process_result .returncode } \n stderr:\n { err } \n stdout:\n { out } "
36
+ )
37
+ )
29
38
30
39
if err != "" :
31
- print (err , file = sys . stderr )
40
+ logger . error (err )
32
41
33
42
return out
34
43
You can’t perform that action at this time.
0 commit comments