Methods
ConLog(text, typeopt) → {void}
This is the core logging function.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text | * | You can log anything, not just text | |
type | number | | <optional> | TYPE OPTIONS: - Error: {1, `er`, `err`, `error`} - Success: {2, `ok`} - Warning: {3, `wa`, `war`, `warn`, `warning`} - Object: {4, `so`, `ob`, `obj`, `object`, `showobject`} |
Returns:
- Type:
- void
Example
ConLog('', 'ok')ConLogHookPost(logType, logText)
Function to post logs to a webhook.
Parameters:
| Name | Type | Description |
|---|---|---|
logType | string | | defines what type of log is being sent. |
logText | string | | text or object to be sent to the webhook. |
- Source
ConLogInit(status) → {void}
Initialize ConLog with global enable/disable setting.
Parameters:
| Name | Type | Description |
|---|---|---|
status | boolean | Master switch for all console logging - true: Enable all ConLog output (default) - false: Completely disable all ConLog output |
- Source
Returns:
- Type:
- void
ConLogSet(options) → {void}
Configure which log types are displayed. All parameters default to true, so you only need to specify false values.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | Configuration optionsProperties
|
- Source
Returns:
- Type:
- void
Example
ConLogSet({error: false, ok: false, warning: false, object: false, color: false})ConLogStartMsg(status) → {void}
Display startup message showing current ConLog settings. Useful for debugging or confirming ConLog is properly initialized.
Parameters:
| Name | Type | Description |
|---|---|---|
status | boolean | Whether to display startup message (default: false) |
- Source
Returns:
- Type:
- void
ConLogSyntax(syntaxObject) → {object}
Function to highlight objects.
Parameters:
| Name | Type | Description |
|---|---|---|
syntaxObject | object | object for syntax highlighter |
- Source
Returns:
- Type:
- object
ConLogWebhook(status, provider, url)
Initialize ConLogWebhook to send logs to a webhook.
Parameters:
| Name | Type | Description |
|---|---|---|
status | boolean | Enable or disable webhook logging - true: Enable all ConLog output to the specified webhook URL - false: Completely disable all ConLog output to webhooks (default) |
provider | string | The webhook provider (e.g., "discord") |
url | string | The webhook URL to send messages to |
- Source
(async) webhookDiscord(type, text)
Function that sends to discord webhook.
Parameters:
| Name | Type | Description |
|---|---|---|
type | string | | defines what type of log is being sent |
text | string | | text or object to be sent to the webhook |
- Source