Logger

Introduction

To use the following methods, you need to use the version 3.6 or higher of LeoCorpLibrary, and put this in your "using" region:

C#

using LeoCorpLibrary;

VB

Imports LeoCorpLibrary

Functions

a. Log

This function is available in version 3.6 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

It's in:

LeoCorpLibrary.Logger.Log()

This method has two variations.

Variation 1

TypeArgumentDescription
stringmessageThe log message to be written
stringfilePathThe path to the log file, must contain an extension

Variation 2

TypeArgumentDescription
stringmessageThe log message to be written
stringfilePathThe path to the log file, must contain an extension
DateTimeDateTimeThe date time of the log

Here's an example of usage:

C#

// Variation 1
Logger.Log("This is an example log message", "C:\\log.txt");

// Variation 2
Logger.Log("This is an example log message", "C:\\log.txt", DateTime.Now);

VB

' Variation 1
Logger.Log("This is an example log message", "C:\\log.txt")

' Variation 2
Logger.Log("This is an example log message", "C:\\log.txt", DateTime.Now)

Go to top