LogType Property

Description:

mCore™ gives you the possibility of creating a log file of errors and events. The log file is created by the name 'mCore.log' and is stored in the folder specified by the LogFolderPath property.

The LogType property defines whether logging is to be enabled and if yes then what kind of logging is required.

   

Usage ObjectName.LogType = intLogType
Value Type Integer
Access Mode Read/Write
Valid Values
  • 0 - No log is generated
  • 1 - Only errors are logged
  • 2 - Errors and modem communication status are logged
Default Value 0
Remarks
  • Enabling of log file (especially in mode 2) can slow down the working of mCore™ if the log file is allowed to grow uncontrolled.
  • Monitoring of the property LogSize and use of ClearLog method accordingly is recommended to ensure that the log file does not grow to a very large size.

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.LogFolderPath = "c:\MyLogs"
If objSMS.LogSize > 100 Then
     objSMS.ClearLog(10)
End If
objSMS.LogType = 2
objSMS.Port = "COM3"
objSMS.BaudRate = 19200
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
' It is not necessary to execute the 'Connect' method.
' Connection state is detected internally by mCore and
' the 'Connect' method is executed accordingly.
objSMS.PIN = "1234"
objSMS.MessageMemory = "ME"
If objSMS.Inbox.Refresh Then
     If objSMS.Inbox.Count > 0 Then
          MsgBox "Total " & objSMS.Inbox.Count & " messages."
          For i = 1 To objSMS.Inbox.Count
               MsgBox "From: " & objSMS.Inbox.Message(i).Phone & _
                VbCrLf & "Message: " & objSMS.Inbox.Message(i).Text
          Next
     End If
End If
' Disconnect method is executed internally
' whenever the SMS object is terminated.
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved