3.4 KiB
LLamaDefaultLogger
Namespace: LLama.Common
The default logger of LLamaSharp. On default it write to console. Use methods of LLamaLogger.Default
to change the behavior.
It's recommended to inherit ILLamaLogger
to customize the behavior.
public sealed class LLamaDefaultLogger : ILLamaLogger
Inheritance Object → LLamaDefaultLogger
Implements ILLamaLogger
Properties
Default
Get the default logger instance
public static LLamaDefaultLogger Default { get; }
Property Value
Methods
EnableNative()
Enable logging output from llama.cpp
public LLamaDefaultLogger EnableNative()
Returns
EnableConsole()
Enable writing log messages to console
public LLamaDefaultLogger EnableConsole()
Returns
DisableConsole()
Disable writing messages to console
public LLamaDefaultLogger DisableConsole()
Returns
EnableFile(String, FileMode)
Enable writing log messages to file
public LLamaDefaultLogger EnableFile(string filename, FileMode mode)
Parameters
filename
String
mode
FileMode
Returns
DisableFile(String)
Caution
Use DisableFile method without 'filename' parameter
Disable writing log messages to file
public LLamaDefaultLogger DisableFile(string filename)
Parameters
filename
String
unused!
Returns
DisableFile()
Disable writing log messages to file
public LLamaDefaultLogger DisableFile()
Returns
Log(String, String, LogLevel)
Log a message
public void Log(string source, string message, LogLevel level)
Parameters
source
String
The source of this message (e.g. class name)
message
String
The message to log
level
LogLevel
Severity level of this message
Info(String)
Write a log message with "Info" severity
public void Info(string message)
Parameters
message
String
Warn(String)
Write a log message with "Warn" severity
public void Warn(string message)
Parameters
message
String
Error(String)
Write a log message with "Error" severity
public void Error(string message)
Parameters
message
String