跳轉到內容

WebObjects/Web 應用程式/開發/WOEvents 和日誌記錄

來自 Wikibooks,開放的書籍,開放的世界

NSDebugLevel

[編輯 | 編輯原始碼]

以下是可以用的除錯級別(WebObjects 5.2.2)

  • DebugLevelOff 0
  • DebugLevelCritical 1
  • DebugLevelInformational 2
  • DebugLevelDetailed 3

NSDebugGroups

[編輯 | 編輯原始碼]

除錯組被定義為 64 位陣列中的標誌。 文件中顯示的值是該陣列中特定除錯組標誌的索引。

例如,如果你想開始記錄 WebObjects 和 EO 除錯資訊,你可以這樣做

 NSLog.allowDebuggingForGroups(NSLog.DebugGroupWebObjects|NSLog.DebugGroupEnterpriseObjects);

或者

 NSLog.allowDebuggingForGroups(6);  // Flags 2 and 1, i.e. 6 = 1L<<2 | 1L<<1

你可以在命令列引數中指定除錯組,可以是單個數值(如上),也可以是標誌列表或標誌範圍。 例如,以下所有都是等效的

 ./MyApp -DNSDebugGroups=6
 ./MyApp -DNSDebugGroups="(2, 1)"
 ./MyApp -DNSDebugGroups="(NSLog.DebugGroupWebObjects, NSLog.DebugGroupEnterpriseObjects)"
 ./MyApp -DNSDebugGroups=1:2

以下是可以用的除錯組(WebObjects 5.2.2)

  • DebugGroupApplicationGeneration 3
  • DebugGroupArchiving 6
  • DebugGroupAssociations 19
  • DebugGroupComponentBindings 9
  • DebugGroupControllers 20
  • DebugGroupComponents 26
  • DebugGroupDatabaseAccess 16
  • DebugGroupDeployment 22
  • DebugGroupEnterpriseObjects 1
  • DebugGroupFormatting 10
  • DebugGroupIO 13
  • DebugGroupJSPServlets 27
  • DebugGroupKeyValueCoding 8
  • DebugGroupModel 15
  • DebugGroupMultithreading 4
  • DebugGroupParsing 23
  • DebugGroupQualifiers 11
  • DebugGroupReflection 24
  • DebugGroupRequestHandling 25
  • DebugGroupResources 5
  • DebugGroupRules 21
  • DebugGroupSQLGeneration 17
  • DebugGroupTiming 14
  • DebugGroupUserInterface 18
  • DebugGroupValidation 7
  • DebugGroupWebObjects 2
  • DebugGroupWebServices 2
華夏公益教科書