You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.common.llamadefaultlogger.md 2.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # LLamaDefaultLogger
  2. Namespace: LLama.Common
  3. The default logger of LLamaSharp. On default it write to console. User methods of `LLamaLogger.Default` to change the behavior.
  4. It's more recommended to inherit `ILLamaLogger` to cosutomize the behavior.
  5. ```csharp
  6. public sealed class LLamaDefaultLogger : ILLamaLogger
  7. ```
  8. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  9. Implements [ILLamaLogger](./llama.common.illamalogger.md)
  10. ## Properties
  11. ### **Default**
  12. ```csharp
  13. public static LLamaDefaultLogger Default { get; }
  14. ```
  15. #### Property Value
  16. [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  17. ## Methods
  18. ### **EnableConsole()**
  19. ```csharp
  20. public LLamaDefaultLogger EnableConsole()
  21. ```
  22. #### Returns
  23. [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  24. ### **DisableConsole()**
  25. ```csharp
  26. public LLamaDefaultLogger DisableConsole()
  27. ```
  28. #### Returns
  29. [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  30. ### **EnableFile(String, FileMode)**
  31. ```csharp
  32. public LLamaDefaultLogger EnableFile(string filename, FileMode mode)
  33. ```
  34. #### Parameters
  35. `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  36. `mode` [FileMode](https://docs.microsoft.com/en-us/dotnet/api/system.io.filemode)<br>
  37. #### Returns
  38. [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  39. ### **DisableFile(String)**
  40. ```csharp
  41. public LLamaDefaultLogger DisableFile(string filename)
  42. ```
  43. #### Parameters
  44. `filename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  45. #### Returns
  46. [LLamaDefaultLogger](./llama.common.llamadefaultlogger.md)<br>
  47. ### **Log(String, String, LogLevel)**
  48. ```csharp
  49. public void Log(string source, string message, LogLevel level)
  50. ```
  51. #### Parameters
  52. `source` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  53. `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  54. `level` [LogLevel](./llama.common.illamalogger.loglevel.md)<br>
  55. ### **Info(String)**
  56. ```csharp
  57. public void Info(string message)
  58. ```
  59. #### Parameters
  60. `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  61. ### **Warn(String)**
  62. ```csharp
  63. public void Warn(string message)
  64. ```
  65. #### Parameters
  66. `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  67. ### **Error(String)**
  68. ```csharp
  69. public void Error(string message)
  70. ```
  71. #### Parameters
  72. `message` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>