registeruserfunc "webedit","set","writelog_webedit_set"
function writelog_webedit_set(object,setvalue)
object.set setvalue '執行原來的設定值的步驟
'定義i/o模式
const forreading = 1
const forwriting = 2
set fso = createobject("scripting.filesystemobject")
logfilename = cstr(year(now)&month(now)&day(now))+ ".txt"
oparentfolder = environment("resultdir") '返回當前測試的測試報告的儲存位址,不包括最後的「\」
logfilepath = oparentfolder+ "\" +logfilename
print logfilepath
'判斷日誌檔案是否存在,若不存在,則建立乙個新檔案;若在直接開啟
if not fso.fileexists(logfilepath) then
set txtfile = fso.createtextfile(logfilepath,false)
else
print "open"
end if
'等待寫入日誌的內容
writecontent = cstr(time)+"object:["+object.gettoproperty("micclass")+ "-" +object.gettoproperty("testobjectname")+"]-descript:"+"set value is <"+ setvalue+">"
'寫入操作
txtfile.writeline writecontent
set txtfile = nothing
set fso = nothing
end function
自定義日誌工具
import android.util.log created by xiongxl on 2017 2 20.public class logutil public static void d string tag,string msg public static void i string ta...
自定義日誌檔案
借用 部落格 usr bin python coding utf 8 importlogging importos.path importtime 自定義日誌類 classlogger object def init self,logger 指定儲存日誌的檔案路徑,日誌級別,以及呼叫檔案 將日誌存入...
自定義日誌記錄檔案
舉例 郵件傳送錯誤記錄日誌 日誌記錄介面 ilogservice.cs public inte ce ilogservice 日誌記錄介面 實現 filelogservice.cs public class filelogservice ilogservice finally catch endre...