2015-04-22 60 views
1

我做的后续使用LogginSession保存日志文件和它们写入文件:有没有办法在WinJS中保存Windows.Foundation.Diagnostics.LoggingSession文本?

loggingChannel = new Windows.Foundation.Diagnostics.LoggingChannel("FlSMobileLogger"); 
LoggingSession = new Windows.Foundation.Diagnostics.LoggingSession("FLSMobileLog"); 
LoggingSession.addLoggingChannel(loggingChannel); 

.... 

function enteredWhenLogEventOccurs(message) { 

      var dateString = new Date().toJSON(); 
      var currentDate = dateString.substring(0, 4) + "-" + dateString.substring(5, 7) + "-" + dateString.substring(8, 10); 
      var fileName = "log" + currentDate + ".log"; 

      loggingChannel.logMessage(message); 
      LoggingSession.saveToFileAsync(WinJS.Application.local.folder, fileName);      
     } 

这些logsession被保存为二进制文件.etl。 有没有办法将它们保存为文本或以任何方式转换它们?

在此先感谢!

回答

相关问题