⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logsrv.script

📁 Software Testing Automation Framework (STAF)的开发代码
💻 SCRIPT
📖 第 1 页 / 共 4 页
字号:
:xmp.Log Name Date-Time         U-Size L-Size-------- ----------------- ------ ------HandLog1 20070210-10:54:00 0      19043HandLog2 20070211-18:23:00 0      45264:exmp.:p.:li.:hp2.Goal::ehp2. Show me the current operational settings.:p.:hp2.Syntax::ehp2.&nbsp; :xph.LIST SETTINGS:exph.:p.:hp2.Results::ehp2.  If the request is submitted from thecommand line, the result, in default format, could look like::xmp.Logging Mode             : LocalDirectory                : C:\STAF\data\STAF\service\logMax Record Size          : 100000Default Max Query Records: 100Resolve Message          : DisabledResolve Message Var      : Disabled:exmp.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.DELETE:i3.log service:h3.DELETEDelete a log file.:h4.Syntax:xmp.DELETE <GLOBAL | MACHINE <Machine> &lbrk.HANDLE <Handle>&rbrk.> LOGNAME<Logname> CONFIRM:exmp.:p.:xph.GLOBAL:exph. indicates you want to delete a global log.:p.:xph.MACHINE:exph. indicates you want to delete a machine log. Specify the machine nickname.  &varres.:p.:xph.HANDLE:exph. indicates you want to delete a handle log. &varres.:p.:xph.LOGNAME:exph. contains the name of the log you want to delete. &varres.:p.:xph.CONFIRM:exph. confirms you really want to delete the log file.:h4.Security:p.&seclvl. 4.:h4.Return Codes:p.In addition to the return codes documented in :hdref refid=retcode.,DELETE also returns codes documented in :hdref refid=logerr..:h4.Results:p.The result buffer will contain no data on return from a DELETE command.:h4.Examples:ul.:li.:xph.DELETE GLOBAL LOGNAME stresstst CONFIRM:exph.:li.:xph.DELETE MACHINE automate.austin.ibm.com LOGNAME autoglob CONFIRM:exph.:li.:xph.DELETE MACHINE testmachine1 HANDLE 45 LOGNAME handlog5 CONFIRM:exph.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.PURGE:i3.log service:h3.PURGEPurge selected records from a log file.  The purge command will lock the log file during the entire purge process.It is recommended that you refrain from logging records to a log filethat is being purged.:h4.Syntax:xmp.PURGE  <GLOBAL | MACHINE <Machine> &lbrk.HANDLE <Handle>&rbrk.> LOGNAME <Logname> CONFIRM       &lbrk.LEVELMASK <Mask>&rbrk. &lbrk.QMACHINE <Machine>&rbrk.... &lbrk.QHANDLE <Handle>&rbrk....       &lbrk.NAME <Name>&rbrk.... &lbrk.USER <User>&rbrk.... &lbrk.ENDPOINT <Endpoint>&rbrk....       &lbrk.CONTAINS <String>&rbrk.... &lbrk.CSCONTAINS <String>&rbrk....       &lbrk.STARTSWITH <String>&rbrk.... &lbrk.CSSTARTSWITH <String>&rbrk....       &lbrk.FROM <Timestamp> | AFTER <Timestamp>&rbrk.       &lbrk.BEFORE <Timestamp> | TO <Timestamp>&rbrk.       &lbrk.FROMRECORD <Num>&rbrk. &lbrk.TORECORD <Num>&rbrk.       &lbrk.FIRST <Num> | LAST <Num>&rbrk. :exmp.:p.:xph.GLOBAL:exph. indicates you want to purge a global log.:p.:xph.MACHINE:exph. indicates you want to purge a machine log.  Specify the machine nickname.  &varres.:p.:xph.HANDLE:exph. indicates you want to purge a handle log. &varres.:p.:xph.LOGNAME:exph. contains the name of the log you want to purge. &varres.:p.:xph.CONFIRM:exph. confirms you really want to purge the log file.:p.Purge allows almost the same selection options as Query.See :hdref refid=query. for a list of valid purge selection options withthe exception of TOTAL, STATS, ALL, LONG, and LEVELBITSTRING not allowed.:note.If your purge selection criteria selects every record in the logfile, you will receive an error indicating you need to use DELETE.:enote.:h4.Security:p.&seclvl. 4.:h4.Return Codes:p.In addition to the return codes documented in :hdref refid=retcode.,PURGE also returns codes documented in :hdref refid=logerr..:h4.Results:p.The result buffer will contain a marshalled:xph.<Map&colon.STAF/Service/Log/PurgeStats>:exph., representingthe number of log records that were purged and the total number oflog records.  The map is defined as follows::table cols='* * * *'.:tcap.Definition of map class STAF/Service/Log/PurgeStats:tnote text='Description'.This map class respresents the purge statistics for the log.:thd.:c.Key Name:c.Display Name:c.Type:c.Format / Value:ethd.:row.:c.purgedRecords:c.Purged Records:c.&stringObj.:c.:row.:c.totalRecords:c.Total Records:c.&stringObj.:c.:etable.:p.For example, suppose you submitted a :xph.PURGE:exph. request for a log thatcontained 129 records and 21 of the records met the purge criteria youspecified.  If the :xph.PURGE:exph. request was submitted from thecommand line, the result could look like::xmp keep=2.Purged Records: 21Total Records : 129:exmp.:h4.Examples:ul.:li.:hp2.Goal::ehp2. Purge all the trace and debug entries for global log stresstst:p.:hp2.Syntax::ehp2.&nbsp; :xph.PURGE GLOBAL LOGNAME stresstst CONFIRM LEVELMASK "TRACE TRACE2 TRACE3 DEBUG DEBUG2 DEBUG3":exph.:p.:hp2.Results::ehp2.  If the :xph.PURGE:exph. request was issued from thecommand line, the result could look like::xmp.Purged Records: 8Total Records : 17:exmp.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.SET:i3.log service:h3 id=logset.SETThe SET command allows you to change the operation parameters of the Logservice.:h4.Syntax:xmp.SET  &lbrk.MAXRECORDSIZE <Size>&rbrk. &lbrk.DEFAULTMAXQUERYRECORDS <Number>&rbrk.     &lbrk.ENABLERESOLVEMESSAGEVAR | DISABLERESOLVEMESSAGEVAR&rbrk.     &lbrk.RESOLVEMESSAGE | NORESOLVEMESSAGE&rbrk.:exmp.:p.See section :hdref refid=logparms. for a description of these options.:h4.Security:p.&seclvl. 5.:h4.Return Codes:p.In addition to the return codes documented in :hdref refid=retcode.,SET also returns codes documented in :hdref refid=logerr..:h4.Results:p.The result buffer will contain no data on return from a successful SET command.:h5.Examples:ul.:li.:hp2.Goal::ehp2. Change the maximum record size to 150000:p.:hp2.Syntax::ehp2.&nbsp; :xph.SET MaxRecordSize 150000:exph.:p.:li.:hp2.Goal::ehp2. Change the default maximum number of records returnedon a generic query request to 50:p.:hp2.Syntax::ehp2.&nbsp; :xph.SET DefaultMaxQueryRecords 50:exph.:p.:li.:hp2.Goal::ehp2. Turn on message resolution:p.:hp2.Syntax::ehp2.&nbsp; :xph.SET ResolveMessage:exph.:eul..*.*---------------------------------------------------------------------.*:i1.logging levels:h3 id=loglev.Logging Levels ReferenceLogging levels consist of a 32 byte binary string that represents thelevel type of each record.  You can use the 32 byte binary string orthe description of the level type when referencing a level.  Thefollowing are the valid logging levels along with their appropriate32 byte binary string::p.:table cols='* *'.:tcap.Logging Levels Reference:thd.:c.Level Definition:c.32 Byte Bit String Representation:ethd.:row.:c.:hp2.Fatal:ehp2.:c.00000000000000000000000000000001:row.:c.:hp2.Error:ehp2.:c.00000000000000000000000000000010:row.:c.:hp2.Warning:ehp2.:c.00000000000000000000000000000100:row.:c.:hp2.Info:ehp2.:c.00000000000000000000000000001000:row.:c.:hp2.Trace:ehp2.:c.00000000000000000000000000010000:row.:c.:hp2.Trace2:ehp2.:c.00000000000000000000000000100000:row.:c.:hp2.Trace3:ehp2.:c.00000000000000000000000001000000:row.:c.:hp2.Debug:ehp2.:c.00000000000000000000000010000000:row.:c.:hp2.Debug2:ehp2.:c.00000000000000000000000100000000:row.:c.:hp2.Debug3:ehp2.:c.00000000000000000000001000000000:row.:c.:hp2.Start:ehp2.:c.00000000000000000000010000000000:row.:c.:hp2.Stop:ehp2.:c.00000000000000000000100000000000:row.:c.:hp2.Pass:ehp2.:c.00000000000000000001000000000000:row.:c.:hp2.Fail:ehp2.:c.00000000000000000010000000000000:row.:c.:hp2.Status:ehp2.:c.00000000000000000100000000000000:row.:c.:hp2.<Reserved1>:ehp2.:c.00000000000000001000000000000000:row.:c.:hp2.<Reserved2>:ehp2.:c.00000000000000010000000000000000:row.:c.:hp2.<Reserved3>:ehp2.:c.00000000000000100000000000000000:row.:c.:hp2.<Reserved4>:ehp2.:c.00000000000001000000000000000000:row.:c.:hp2.<Reserved5>:ehp2.:c.00000000000010000000000000000000:row.:c.:hp2.<Reserved6>:ehp2.:c.00000000000100000000000000000000:row.:c.:hp2.<Reserved7>:ehp2.:c.00000000001000000000000000000000:row.:c.:hp2.<Reserved8>:ehp2.:c.00000000010000000000000000000000:row.:c.:hp2.<Reserved9>:ehp2.:c.00000000100000000000000000000000:row.:c.:hp2.User1:ehp2.:c.00000001000000000000000000000000:row.:c.:hp2.User2:ehp2.:c.00000010000000000000000000000000:row.:c.:hp2.User3:ehp2.:c.00000100000000000000000000000000:row.:c.:hp2.User4:ehp2.:c.00001000000000000000000000000000:row.:c.:hp2.User5:ehp2.:c.00010000000000000000000000000000:row.:c.:hp2.User6:ehp2.:c.00100000000000000000000000000000:row.:c.:hp2.User7:ehp2.:c.01000000000000000000000000000000:row.:c.:hp2.User8:ehp2.:c.10000000000000000000000000000000:etable.:note.The :hp2.User1-8:ehp2. logging levels have been set aside for the user ofSTAFLog to implement as deemed necessary.  You may decide that for atestcase or test suite that you want to log a certain behavioras "User1" for example.  This will enable you to easily extractlog records associated with level "User1".:enote.:note.The :hp2.<Reserved1-8>:ehp2. levels cannot be used and as the name implies,they are reserved by STAF for future use. If you would like to see a commonlogging level added to this list, please contact the documentowners for discussion.:enote..*.*---------------------------------------------------------------------.*:ih1.error codes:i2.log service:h3 id=logerr.Log Error Code Reference:p.In addition to the common STAF return codes (see :hdref refid=retcode. for additional information),the following Log return codes are defined::table id     = logerr       headhi = 3       frame  = box       cols   = '* 2* 4*'       align  = 'c l l'.:tcap.Log Service Return Codes:thd.:c.Error Code:c.Meaning:c.Comment:ethd.:row.:c.:hp2.4004:ehp2.:c.Invalid level specified:c.An invalid logging level was specified,See :hdref refid=loglev. for a complete list of logging levels.:row.:c.:hp2.4007:ehp2.:c.Invalid file format:c.Error reading the log data due to an error in the file format.:row.:c.:hp2.4008:ehp2.:c.Failed attempting to purge all records, use DELETE:c.Your purge criteria selected every record to be purged from alog file.  Use DELETE if you really want to delete every recordor modify your purge criteria.:row.:c.:hp2.4010:ehp2.:c.Exceeded default maximum query records:c.Your query criteria selected more records than allowed by theDefaultMaxQueryRecords setting.  Use the FIRST <Num> or LAST <Num> option tospecify the number of records or the ALL option if you really want all of the records.:etable.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -