This commit is contained in:
NoryiE
2025-09-13 20:28:52 +00:00
parent 9e1112f3bd
commit 4ccefcac9f
48 changed files with 3036 additions and 1565 deletions

View File

@@ -1,76 +1,57 @@
# Log
Logger module for Basalt. Logs messages to the console and optionally to a file.
## Fields
|Field|Type|Description|
|---|---|---|
|_logs|`table`|The complete log history|
|_enabled|`boolean`|If the logger is enabled|
|_logToFile|`boolean`|If the logger should log to a file|
|_logFile|`string`|The file to log to|
|LEVEL|`table`|The log levels|
_Logger module for Basalt. Logs messages to the console and optionally to a file._
## Functions
|Method|Returns|Description|
|---|---|---|
|[Log.debug](#log-debug)|-|Sends a debug message
|[Log.error](#log-error)|-|Sends an error message
|[Log.info](#log-info)|-|Sends an info message
|[Log.setEnabled](#log-setenabled)|-|Sets if the logger should log
|[Log.setLogToFile](#log-setlogtofile)|-|Sets if the logger should log to a file
|[Log.warn](#log-warn)|-|Sends a warning message
|[Log.setLogToFile](#log-setlogtofile)|-|Sets if the logger should log to a file|
|[Log.setEnabled](#log-setenabled)|-|Sets if the logger should log|
|[Log.debug](#log-debug)|-|Sends a debug message|
|[Log.info](#log-info)|-|Sends an info message|
|[Log.warn](#log-warn)|-|Sends a warning message|
|[Log.error](#log-error)|-|Sends an error message|
## Log.setLogToFile()
Sets if the logger should log to a file.
## Log.setEnabled()
Sets if the logger should log
## Log.debug()
## Log.debug(...)
Sends a debug message to the logger.
### Parameters
* `...` *(vararg)* `string` The message to log
### Usage
```lua
```lua
Log.debug("This is a debug message")
```
## Log.error(...)
Sends an error message to the logger.
## Log.info()
### Parameters
* `...` *(vararg)* `string` The message to log
### Usage
```lua
Log.error("This is an error message")
```
## Log.info(...)
Sends an info message to the logger.
### Parameters
* `...` *(vararg)* `string` The message to log
### Usage
```lua
```lua
Log.info("This is an info message")
```
## Log.setEnabled()
Sets if the logger should log
## Log.warn()
## Log.setLogToFile()
Sets if the logger should log to a file.
## Log.warn(...)
Sends a warning message to the logger.
### Parameters
* `...` *(vararg)* `string` The message to log
### Usage
```lua
```lua
Log.warn("This is a warning message")
```
## Log.error()
Sends an error message to the logger.
### Usage
```lua
Log.error("This is an error message")
```