로깅 모듈
이 모듈은 Substance Painter 로거에 메시지를 출력하는 몇 가지 기능을 표시합니다. 메시지의 심각도에 따라 info(), warning() 또는 error()을(를) 사용하십시오.
로깅 매개 변수(예: 심각도 및 채널)를 보다 세밀하게 제어하려면 log()을(를) 사용하십시오. info(), warning() 및 error() 함수는 ‘Python’ 로그 채널에 출력되지만 log()은(는) 다른 채널을 지정할 수 있습니다.
심각도 수준이 INFO, WARNING 및 ERROR인 메시지는 최종 사용자를 위한 것이며 Substance 3D Painter의 로그 창에 나타납니다. 심각도 수준이 DBG_INFO, DBG_WARNING 및 DBG_ERROR인 메시지는 개발자용이며 로그 파일에 나타납니다.
예
import substance_painter.logging
# Simple log functions:
substance_painter.logging.info("Everyone knows that 2 + 2 is {0}.".format(2+2))
substance_painter.logging.warning("Maybe the user should look at this.")
substance_painter.logging.error("Letting the user know that something went wrong.")
# Log function with more options:
substance_painter.logging.log(
substance_painter.logging.INFO,
"Python",
"An informative log message to the 'Python' channel.")
substance_painter.logging.log(
substance_painter.logging.ERROR,
"MyPlugin",
"An error log message to the 'MyPlugin' channel.")
substance_painter.logging.error(메시지: str) substance_painter.logging.error
Substance 3D Painter 로거에 ERROR 수준의 메시지를 기록합니다.
매개 변수: 메시지(str) - 기록할 오류 메시지입니다.
substance_painter.logging.info(메시지: str) substance_painter.logging.info
Substance 3D Painter 로거에 INFO 수준의 메시지를 기록합니다.
매개 변수: 메시지(str) - 기록할 메시지입니다.
substance_painter.logging.log(심각도, 채널: str, 메시지: str) substance_painter.logging.log
Substance 3D Painter 로거에 레벨 심각도가 있는 메시지를 기록합니다.
매개 변수:
- 심각도 - 심각도 수준은 최종 사용자와 관련된 메시지의 경우
INFO,WARNING또는ERROR일 수 있고, 개발자와 관련된 메시지의 경우DBG_INFO,DBG_WARNING또는DBG_ERROR일 수 있습니다. - 채널(str) - 로그인할 채널입니다. 이는 메시지의 출처(예: 플러그인 이름)를 식별할 수 있는 모든 이름일 수 있습니다.
- 메시지(str) - 기록할 메시지입니다.
substance_painter.logging.warning(메시지: str) substance_painter.logging.warning
Substance 3D Painter 로거에 WARNING 수준의 메시지를 기록합니다.
매개 변수: 메시지(str) - 기록할 경고 메시지입니다.
recommendation-more-help
substance-3d-dev-help-painter-python-guide