Skip to content

Commit f9fa8c5

Browse files
committed
more error log
1 parent 009b750 commit f9fa8c5

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

backend/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def load_yaml(file_path: str, chk_schema=None) -> dict:
184184

185185
product_version = PRODUCT_VERSION if PRODUCT_VERSION != "Default string" else ""
186186
key = f"{PRODUCT_NAME}{product_version}"
187-
logging.info(f"风扇配置key: {key}")
187+
logging.info(f"fans config key: {key}")
188188
FAN_EC_CONFIG = FAN_EC_CONFIG_MAP.get(key, [])
189189
logging.info(f"FAN_EC_CONFIG: {FAN_EC_CONFIG}")
190190

backend/cpu.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import subprocess
22
import os
33
import re
4+
import traceback
45
from config import logging, SH_PATH, RYZENADJ_PATH
56
from config import (
67
TDP_LIMIT_CONFIG_CPU,
78
TDP_LIMIT_CONFIG_PRODUCT,
89
PRODUCT_NAME,
910
CPU_ID,
10-
PLATFORM_PROFILE_PATH,
11-
PLATFORM_PROFILE_CHOICES_PATH,
1211
)
1312

1413
# 初始参数
@@ -50,6 +49,7 @@ def get_hasRyzenadj(self):
5049
logging.info("get_hasRyzenadj {}".format(False))
5150
return False
5251
except Exception as e:
52+
logging.error(traceback.format_exc())
5353
logging.error(e)
5454
return False
5555

@@ -139,23 +139,24 @@ def set_cpuTDP(self, value: int):
139139

140140
command = f"{sys_ryzenadj_path} -a {stapm_limit} -b {fast_minit} -c {slow_limit} -f {tctl_temp}"
141141
command_args = command.split()
142-
logging.info(f"set_cpuTDP command: {command}")
143-
logging.info(f"set_cpuTDP {value}")
142+
logging.debug(f"set_cpuTDP command: {command}")
143+
logging.debug(f"set_cpuTDP {value}")
144144
process = subprocess.run(
145145
command_args,
146146
stdout=subprocess.PIPE,
147147
stderr=subprocess.PIPE,
148148
text=True,
149149
)
150150
stdout, stderr = process.stdout, process.stderr
151-
logging.info(f"set_cpuTDP result:\n{stdout}")
151+
logging.debug(f"set_cpuTDP result:\n{stdout}")
152152
if stderr:
153153
logging.error(f"set_cpuTDP error:\n{stderr}")
154154

155155
return True
156156
else:
157157
return False
158158
except Exception as e:
159+
logging.error(traceback.format_exc())
159160
logging.error(e)
160161
return False
161162

@@ -216,6 +217,7 @@ def set_cpuOnline(self, value: int):
216217
self.online_cpu(int(cpu))
217218
return True
218219
except Exception as e:
220+
logging.error(traceback.format_exc())
219221
logging.error(e)
220222
return False
221223

@@ -258,6 +260,7 @@ def get_isSupportSMT(self):
258260
else:
259261
self.is_support_smt = int(stdout) > 1
260262
except Exception as e:
263+
logging.error(traceback.format_exc())
261264
logging.error(e)
262265
self.is_support_smt = False
263266
return self.is_support_smt
@@ -272,6 +275,7 @@ def set_smt(self, value: bool):
272275
cpu_smt = value
273276
return True
274277
except Exception as e:
278+
logging.error(traceback.format_exc())
275279
logging.error(e)
276280
return False
277281

@@ -307,6 +311,7 @@ def set_cpuBoost(self, value: bool):
307311

308312
return True
309313
except Exception as e:
314+
logging.error(traceback.format_exc())
310315
logging.error(e)
311316
return False
312317

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import traceback
23
import decky_plugin
34
from settings import SettingsManager
45

@@ -17,7 +18,6 @@
1718

1819
except Exception as e:
1920
# 堆栈跟踪
20-
import traceback
2121
logging.error(traceback.format_exc())
2222
logging.error(e)
2323

0 commit comments

Comments
 (0)