%XSQL.Log
Class %XSQL.Log Extends %Library.RegisteredObject [ System = 2 ]
Properties
logFile
Property logFile As %String;
Methods
%OnNew
Method %OnNew(logFile As %RawString = "", initialize As %Boolean = 0) As %Status [ Private, ProcedureBlock = 1, ServerOnly = 1 ]
This callback method is invoked by the %New method to provide notification that a new instance of an object is being created.
If this method returns an error then the object will not be created.
It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
Method %OnNew(dob as %Date = "", name as %Name = "") as %Status
%OnClose
Method %OnClose() As %Status [ Private ]
write
Method write(message As %String(MAXLEN=""), linesBefore As %Integer = 0, linesAfter As %Integer = 1) As %Status
write() - write a message to the current log file
ActivateLog
ClassMethod ActivateLog() As %Integer [ SqlName = activate_log, SqlProc ]
ActivateLog (also called as a procedure - CALL InSync_SYS.activate_log()) will set the trace switch to begin logging. Messages logged using $$$TRACE macros will be written to the log file.
DeactivateLog
ClassMethod DeactivateLog() As %Integer [ SqlName = deactivate_log, SqlProc ]
DeactivateLog (also callable as a procedure - CALL InSync_SYS.deactivate_log()) will turn of the trace switch so that $$$TRACE macros will not longer be written to the log file. The log file is also closed.
logError
Method logError(pError As %SYSTEM.Error)
Report an error from a %SYSTEM.Error object
pError - an instance of %SYSTEM.Error
logException
Method logException(pException As %Exception.AbstractException, pPrefix As %String = {$Char(9,9)})
logValue
Method logValue(pName As %String(MAXLEN="") = "", pValue As %String(MAXLEN="") = "")
Report a named value
pName - the name of the value, for example, 'pFormal1' as the name of a formal argument pValue - the value
logFunction
Method logFunction(pName As %String(MAXLEN="") = "", pValue As %String(MAXLEN="") = "")
Report a function and its return value.
pName - the name of the value, for example, 'pFormal1' as the name of a formal argument pValue - the value
logStream
Method logStream(stream As %Stream.Object, pNumbered As %Integer = 0)
Copy the contents of a stream to the log
stream - stream to copy to the file.
logStatus
Method logStatus(StatusCode As %Status, Message As %String, ByRef Outcome) As %Integer
Report a status message from a trace
sc - pass as status code message - pass a message to be written both to the current device and to the log (or "") (optional) outcome - pass an array of stats (optional)
logHeader
Method logHeader() As %Status
logStatementResult
Method logStatementResult(pResult As %SQL.StatementResult) As %Status
Log the contents of a %SQL.StatementResult object
logStatementSource
Method logStatementSource(pBatchNumber As %Library.Integer, ByRef pSource As %Library.String(MAXLEN=""), pLinesBefore As %Integer = 0, pLinesAfter As %Integer = 1) As %Status
Log SQL statement source
logResults
Method logResults(context As %Library.ProcedureContext) As %Status
logResultSet
Method logResultSet(pContext As %Library.ProcedureContext, pResultSet As %Library.IResultSet) As %Status
logEnterProcedure
Method logEnterProcedure(pProcedureName As %Library.String, ByRef pArguments As %Library.String) As %Status
logEmbeddedSQL
Method logEmbeddedSQL(pStatement As %Library.String, pSQLCODE As %Library.Integer, pMsg As %Library.String, pROWCOUNT As %Library.Integer, pTime As %Library.Numeric, ByRef pArguments As %Library.String) As %Status
logSQLCODE
Method logSQLCODE(pSQLCODE As %Library.Integer = 0, pMessage As %String(MAXLEN="") = "", pPrefix As %String = {$Char(9,9)}) As %Status
Log an SQLCODE and %msg value
- pSQLCODE - the SQLCODE value
- pMessage - the %msg value
- pPrefix - the prefix to use when writing the log content, defaults to two tab characters.
prepareLog
ClassMethod prepareLog()
startLog
ClassMethod startLog(logFile As %RawString = "", initialize As %Boolean = 0) As %Status
stopLog
ClassMethod stopLog() As %Status
traceMessage
ClassMethod traceMessage(message As %String(MAXLEN=""), linesBefore As %Integer = 0, linesAfter As %Integer = 1) As %Status
traceDeferredStatement
ClassMethod traceDeferredStatement(statementType, ByRef sql As %String(MAXLEN="") = "", ByRef %args As %String(MAXLEN="") = "") As %Status
traceContext
ClassMethod traceContext(context As %Library.ProcedureContext) As %Status
traceException
ClassMethod traceException(pException As %Exception.AbstractException, pPrefix As %Library.String = {$Char(9)}) [ ProcedureBlock = 1 ]
Report an exception from a trace
pException - pass as an exception oref
traceStatus
ClassMethod traceStatus(StatusCode As %Status, Message As %String, ByRef Outcome)
Report a status message from a trace
sc - pass as status code message - pass a message to be written both to the current device and to the log (or "") (optional) outcome - pass an array of stats (optional)
traceError
ClassMethod traceError(pError As %SYSTEM.Error) As %Status
Report an error from a %SYSTEM.Error object
error - an instance of %SYSTEM.Error
traceValue
ClassMethod traceValue(pName As %String(MAXLEN="") = "", pValue As %String(MAXLEN="") = "")
Report a named value
pName - the name of the value, for example, 'pFormal1' as the name of a formal argument pValue - the value
traceFunction
ClassMethod traceFunction(pName As %String(MAXLEN="") = "", pValue As %String(MAXLEN="") = "")
Report a function and its return value.
pName - the name of the function method pValue - the return value
traceResult
ClassMethod traceResult(pContext As %Library.ProcedureContext) As %Status
traceResultSet
ClassMethod traceResultSet(pContext As %Library.ProcedureContext, pResultSet As %Library.IResultSet) As %Status
traceEmbeddedSQL
ClassMethod traceEmbeddedSQL(pStatement As %Library.String, pSQLCODE As %Library.Integer, pMsg As %Library.String, pROWCOUNT As %Library.Integer, pTime As %Library.Numeric, pArguments... As %Library.String) As %Status
Report a execution of embedded/deferred SQL, its arguments, and status.
pStatement - the text of the SQL Statement executed pArguments - the Arguments and their values pSQLCODE - the resulting SQLCODE pMsg - the resuting %msg (if any) pROWCOUNT - the resulting %ROWCOUNT (if any) pTime - the execution time (if any)
traceSQLCODE
ClassMethod traceSQLCODE(pSQLCODE As %Library.Integer = 0, pMessage As %String(MAXLEN="") = "", pPrefix As %String = {$Char(9,9)}) As %Status
Log an SQLCODE and %msg value
- pSQLCODE - the SQLCODE value
- pMessage - the %msg value
- pPrefix - the prefix to use when writing the log content, defaults to two tab characters.
traceEnterProcedure
ClassMethod traceEnterProcedure(pProcedureName As %String, pArguments... As %Library.String) As %Status
traceEnterFunction
ClassMethod traceEnterFunction(pProcedureName As %String, pArguments... As %Library.String) As %Status
traceExitProcedure
ClassMethod traceExitProcedure() As %Status