SikuliX:ログ出力(標準機能)

シナリオ

  • SikuliX のログ出力機能を使用する。
  • 出力先: c:¥Logs
  • ファイル名: log_YYYYMMDD-HHMMSS.txt
  • 接頭辞: sample

サンプルコード

import datetime

SAVE_PATH = u"C:\\Logs\\" 

now = datetime.datetime.today()
date = now.strftime("%Y%m%d-%H%M%S") #現在時刻YYYYMMDD-HHMMSS

Settings.UserLogs = True
Settings.UserLogPrefix = "sample"
Debug.setUserLogFile(SAVE_PATH + "log_" + date + ".txt")
Debug.user("start")
Debug.user("end")

結果

[sample (21/02/25 21:33:19)] start
[sample (21/02/25 21:33:19)] end