Logger - Leo-Corporation/LeoCorpLibrary GitHub Wiki

Table of content


Introduction

To use the following methods, you need to use the version 3.6 or higher of LeoCorpLibrary, and put this on top of your code file:

C#

using LeoCorpLibrary;

VB

Imports LeoCorpLibrary

Functions

a. Log

This function is available in version 3.6 and higher.

Compatibility
Framework LeoCorpLibrary LeoCorpLibrary.Core
.NET 5
.NET Core 3.1
.NET Framework 4.7.2
.NET Framework 4.5

It's in:

LeoCorpLibrary.Logger.Log()

This method has two varations.

Variation 1

Type Argument Description
string message The log message to be written
string filePath The path to the log file, must contain an extension

Variation 2

Type Argument Description
string message The log message to be written
string filePath The path to the log file, must contain an extension
DateTime DateTime The 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

⚠️ **GitHub.com Fallback** ⚠️