Skip to content

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 ObjectLLamaDefaultLogger
Implements ILLamaLogger

Properties

Default

Get the default logger instance

public static LLamaDefaultLogger Default { get; }

Property Value

LLamaDefaultLogger

Methods

EnableNative()

Enable logging output from llama.cpp

public LLamaDefaultLogger EnableNative()

Returns

LLamaDefaultLogger

EnableConsole()

Enable writing log messages to console

public LLamaDefaultLogger EnableConsole()

Returns

LLamaDefaultLogger

DisableConsole()

Disable writing messages to console

public LLamaDefaultLogger DisableConsole()

Returns

LLamaDefaultLogger

EnableFile(String, FileMode)

Enable writing log messages to file

public LLamaDefaultLogger EnableFile(string filename, FileMode mode)

Parameters

filename String

mode FileMode

Returns

LLamaDefaultLogger

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

LLamaDefaultLogger

DisableFile()

Disable writing log messages to file

public LLamaDefaultLogger DisableFile()

Returns

LLamaDefaultLogger

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