The LogInfo method logs the supplied message by using an Information level scope.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
void LogInfo(
Func<string> action
)
Argument
action – Func<string>
This argument provides a delegate to a function that defines and optionally formats the message to be written to the log file.
Using the ILogger Interface for the LogInfo, LogDebug, and LogError Methods
The following code is an example of using the various Logging methods supported by the ILogger interface:
// Create a new connection to the AB Suite host system // Use the Access Layer API ConnectionFactory to create an instance of a Connection Interface class // The Create method also allows you to initialize the Access Layer API Logging level and location. ABSConnection = ConnectionFactory.Create(new Sample.Custom.DataModels.Core.IspecFactory(), level: "DEBUG", logPath: @"C:\Temp\MVC"); // Get the Logger object from the IConnection interface ApplicationLogger = ABSConnection.Logger; // Log an information message ApplicationLogger.LogInfo(() => "<Client>:: Log Information message."); // Log a Debug message ApplicationLogger.LogDebug(() => string.Format("<Client>:: Log Debug message.")); // Log an Error message ApplicationLogger.LogError(() => string.Format("<Client>:: Log Error message!"));