Home > Class Reference > %SYS namespace > %XSQL.Log

%XSQL.Log

class %XSQL.Log extends %Library.RegisteredObject

Properties

property logFile as %String;
Property methods: logFileDisplayToLogical(), logFileGet(), logFileIsValid(), logFileLogicalToDisplay(), logFileLogicalToOdbc(), logFileNormalize(), logFileSet()

Methods

classmethod ActivateLog() as %Integer [ SQLProc = activate_log ]
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.
classmethod DeactivateLog() as %Integer [ SQLProc = deactivate_log ]
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.
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
method logEnterProcedure(pProcedureName As %Library.String, ByRef pArguments As %Library.String) as %Status
method logError(pError As %SYSTEM.Error)

Report an error from a %SYSTEM.Error object

  • pError - an instance of %SYSTEM.Error

method logException(pException As %Exception.AbstractException, pPrefix As %String = $Char(9, 9))
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

method logHeader() as %Status
method logResultSet(pContext As %Library.ProcedureContext, pResultSet As %Library.IResultSet) as %Status
method logResults(context As %Library.ProcedureContext) as %Status
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.

method logStatementResult(pResult As %SQL.StatementResult) as %Status
Log the contents of a %SQL.StatementResult object
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
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)

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.

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

classmethod prepareLog()
classmethod startLog(logFile As %CacheString = "", initialize As %Boolean = 0) as %Status
classmethod stopLog() as %Status
classmethod traceContext(context As %Library.ProcedureContext) as %Status
classmethod traceDeferredStatement(statementType, ByRef sql As %String(MAXLEN="")="", ByRef %args As %String(MAXLEN="")="") as %Status
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)

classmethod traceEnterFunction(pProcedureName As %String, pArguments... As %Library.String) as %Status
classmethod traceEnterProcedure(pProcedureName As %String, pArguments... As %Library.String) as %Status
classmethod traceError(pError As %SYSTEM.Error) as %Status

Report an error from a %SYSTEM.Error object

  • error - an instance of %SYSTEM.Error

classmethod traceException(pException As %Exception.AbstractException, pPrefix As %Library.String = $Char(9))

Report an exception from a trace

  • pException - pass as an exception oref

classmethod traceExitProcedure() as %Status
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

classmethod traceMessage(message As %String(MAXLEN=""), linesBefore As %Integer = 0, linesAfter As %Integer = 1) as %Status
classmethod traceResult(pContext As %Library.ProcedureContext) as %Status
classmethod traceResultSet(pContext As %Library.ProcedureContext, pResultSet As %Library.IResultSet) as %Status
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.

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)

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

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

Inherited Methods

%AddToSaveSet() %DispatchSetModified() %NormalizeObject()
%ClassIsLatestVersion() %DispatchSetMultidimProperty() %ObjectModified()
%ClassName() %DispatchSetProperty() %OriginalNamespace()
%ConstructClone() %Extends() %PackageName()
%DispatchClassMethod() %GetParameter() %RemoveFromSaveSet()
%DispatchGetModified() %IsA() %SerializeObject()
%DispatchGetProperty() %IsModified() %SetModified()
%DispatchMethod() %New() %ValidateObject()