Class FileLog
A file log for debugging
Inheritance
Inherited Members
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
public static class FileLog
Fields
| Improve this Doc View SourceindentChar
The indent character
Declaration
public static char indentChar
Field Value
| Type | Description |
|---|---|
| System.Char |
indentLevel
The indent level
Declaration
public static int indentLevel
Field Value
| Type | Description |
|---|---|
| System.Int32 |
logPath
Full pathname of the log file
Declaration
public static string logPath
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceChangeIndent(Int32)
Changes indent depth
Declaration
public static void ChangeIndent(int delta)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | delta | The value to add to the indent level |
FlushBuffer()
Flushes the log buffer to disk (use in combination with LogBuffered)
Declaration
public static void FlushBuffer()
GetBuffer(Boolean)
Returns the log buffer and optionally empties it
Declaration
public static List<string> GetBuffer(bool clear)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | clear | True to empty the buffer |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | The buffer. |
Log(String)
Log a string directly to disk. Slower method that prevents missing information in case of a crash
Declaration
public static void Log(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | The string to log. |
LogBuffered(List<String>)
Logs a list of string in a buffered way. Use this method only if you are sure that FlushBuffer will be called or else logging information is incomplete in case of a crash
Declaration
public static void LogBuffered(List<string> strings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<System.String> | strings | The strings to log (they will not be re-indented) |
LogBuffered(String)
Log a string in a buffered way. Use this method only if you are sure that FlushBuffer will be called or else logging information is incomplete in case of a crash
Declaration
public static void LogBuffered(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | The string to log |
LogBytes(Int64, Int32)
Logs some bytes as hex values
Declaration
public static void LogBytes(long ptr, int len)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | ptr | The pointer to some memory |
| System.Int32 | len | The length of bytes to log |
Reset()
Resets and deletes the log
Declaration
public static void Reset()
SetBuffer(List<String>)
Replaces the buffer with new lines
Declaration
public static void SetBuffer(List<string> buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<System.String> | buffer | The lines to store |