|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- # 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.
-
- ```csharp
- public sealed class LLamaDefaultLogger : ILLamaLogger
- ```
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
- Implements [ILLamaLogger](./llama.common.illamalogger.md)
-
- ## Properties
-
- ### **Default**
-
- Get the default logger instance
-
- ```csharp
- public static LLamaDefaultLogger Default { get; }
- ```
-
- #### Property Value
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ## Methods
-
- ### **EnableNative()**
-
- Enable logging output from llama.cpp
-
- ```csharp
- public LLamaDefaultLogger EnableNative()
- ```
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **EnableConsole()**
-
- Enable writing log messages to console
-
- ```csharp
- public LLamaDefaultLogger EnableConsole()
- ```
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **DisableConsole()**
-
- Disable writing messages to console
-
- ```csharp
- public LLamaDefaultLogger DisableConsole()
- ```
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **EnableFile(String, FileMode)**
-
- Enable writing log messages to file
-
- ```csharp
- public LLamaDefaultLogger EnableFile(string filename, FileMode mode)
- ```
-
- #### Parameters
-
- `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- `mode` [FileMode](https://docs.microsoft.com/en-us/dotnet/api/system.io.filemode)<br>
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **DisableFile(String)**
-
- #### Caution
-
- Use DisableFile method without 'filename' parameter
-
- ---
-
- Disable writing log messages to file
-
- ```csharp
- public LLamaDefaultLogger DisableFile(string filename)
- ```
-
- #### Parameters
-
- `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
- unused!
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **DisableFile()**
-
- Disable writing log messages to file
-
- ```csharp
- public LLamaDefaultLogger DisableFile()
- ```
-
- #### Returns
-
- [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
-
- ### **Log(String, String, LogLevel)**
-
- Log a message
-
- ```csharp
- public void Log(string source, string message, LogLevel level)
- ```
-
- #### Parameters
-
- `source` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
- The source of this message (e.g. class name)
-
- `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
- The message to log
-
- `level` [LogLevel](./llama.common.illamalogger.loglevel.md)<br>
- Severity level of this message
-
- ### **Info(String)**
-
- Write a log message with "Info" severity
-
- ```csharp
- public void Info(string message)
- ```
-
- #### Parameters
-
- `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- ### **Warn(String)**
-
- Write a log message with "Warn" severity
-
- ```csharp
- public void Warn(string message)
- ```
-
- #### Parameters
-
- `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
-
- ### **Error(String)**
-
- Write a log message with "Error" severity
-
- ```csharp
- public void Error(string message)
- ```
-
- #### Parameters
-
- `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
|