mCore™ .NET SMS Library 1.2

mCore.SMS.LogType Property

Description:

mCore™ .NET SMS Library can create a log file of its process steps and errors. The log file is created by the name 'mCoreLib.log' and is stored in the folder specified by the LogFolderPath property. The LogType property sets the log type to one of the following:


The LogType property value is of type mCore.LogType

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Exceptions:

mCore.GeneralException

Remarks:

Enabling of log file 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

Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub InitializeLog()
      Try
         objSMS.LogFolderPath = "C:\MyLogs"
         If objSMS.LogSize > 500 Then
            objSMS.ClearLog(10)
         End If
         objSMS.LogType = mCore.LogType.ErrorEventLog

      Catch ex As mCore.GeneralException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")

      Catch ex As Exception

      End Try
   End Function
End Class

 
C#
class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();
   public static void InitializeLog()
   {
      try
      {
         objSMS.LogFolderPath = "C:\\MyLogs";
         if (objSMS.LogSize > 500)
         {
            objSMS.ClearLog(10);
         }
         objSMS.LogType = mCore.LogType.ErrorEventLog;
      }

      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.SMS.LogFolderPath Property
mCore.SMS.LogSize Property
mCore.SMS.DebugMode Property
mCore.SMS.ClearLog Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved