DbgLog.LogEntry
This function is called for creating an entry in the log.
| Syntax | Parameters | Return Value |
|---|---|---|
Sub DbgLog.LogEntry( _
ProcessId As Integer, _
ThreadId As Integer, _
Level As LogLevel, _
Entry As String)
|
The process ID of Statistica. Type: Integer The thread ID. Pass in 0 to specify the main Statistica thread. Type: Integer The 'importance' level of the message. Type: LogLevel The message to log. Type: String |
This function does not return a value. |
SVB Example
Logging messages and reviewing the debug log:
Sub Main
'Enable debug logging at the highest level
Application.DebugLogEnable = True
Set myLog = Application.DebugLog
myLog.LoggingLevel = scLogEverything
'Show the log report window
Application.DebugReport(scLogEverything).Visible = True
'Log an informational message. Note that specifying 0 as thread ID will
'imply the main thread in the log report.
myLog.LogEntry(Application.ProcessID, 0, scLogLevelInformational, "Opening the dataset")
Dim spr As Spreadsheet
Set spr = Spreadsheets.Open(Path & "\Examples\Datasets\Cat Clinic.sta")
'Iterate through the data before the analysis and log any major issues with the data
Dim i As Long
For i = 1 To spr.NumberOfCases
If spr.Value(i, 9) > 20 Then
myLog.LogEntry(Application.ProcessID, 0, scLogLevelCritical, _
"Case " & spr.CaseName(i) & ": Extremely overweight (" & Trim(Str(spr.Value(i, 9))) & "), review required.")
End If
Next
'Create a histogram
myLog.LogEntry(Application.ProcessID, 0, scLogLevelInformational, "Creating the histogram")
Dim histogram As Analysis
Set histogram = Analysis(sc2dHistograms, spr)
'2D Histograms
Dim oGD As Histogram2D
Set oGD = histogram.Dialog
oGD.Variables = "9 "
histogram.RouteOutput(oGD.Graphs).Visible = True
spr.Close
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
