diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 16:21:20 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-29 16:21:20 -0500 |
commit | 8133ff570d95860609d9b63644887384271ec56c (patch) | |
tree | 7aaa85f65bf96beffc677ff413f68fe0dae130e2 /src/lib/utils/BushLogger.ts | |
parent | 2d7b790b31a2febcea8878a2b0b4b28ec0fbee40 (diff) | |
download | tanzanite-8133ff570d95860609d9b63644887384271ec56c.tar.gz tanzanite-8133ff570d95860609d9b63644887384271ec56c.tar.bz2 tanzanite-8133ff570d95860609d9b63644887384271ec56c.zip |
listen to akairodebug event
Diffstat (limited to 'src/lib/utils/BushLogger.ts')
-rw-r--r-- | src/lib/utils/BushLogger.ts | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 43c9203..e05f5d6 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -1,4 +1,3 @@ -import * as assert from 'assert'; import chalk from 'chalk'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { MessageEmbed, Util, type Message, type PartialTextBasedChannelFields } from 'discord.js'; @@ -162,7 +161,7 @@ export class BushLogger { /** * Logs very verbose information. Highlight information by surrounding it in `<<>>`. - * @param header The header printed before the content, displayed in grey. + * @param header The header printed before the content, displayed in purple. * @param content The content to log, highlights displayed in bright black. * @param depth The depth the content will inspected. Defaults to `0`. */ @@ -178,6 +177,16 @@ export class BushLogger { } /** + * Logs raw very verbose information. + * @param header The header printed before the content, displayed in purple. + * @param content The content to log. + */ + public static async superVerboseRaw(header: string, ...content: any[]): Promise<void> { + if (!client.config.logging.verbose) return; + console.info(`${chalk.bgHex('#8423b8')(this.#getTimeStamp())} ${chalk.hex('#8423b8')(`[${header}]`)}`, ...content); + } + + /** * Logs information. Highlight information by surrounding it in `<<>>`. * @param header The header displayed before the content, displayed in cyan. * @param content The content to log, highlights displayed in bright blue. @@ -268,23 +277,6 @@ export class BushLogger { .setTimestamp(); await this.channelLog({ embeds: [embed] }).catch(() => {}); } - - /** - * Asserts a condition. If the condition is false, an error is thrown. - * @param type The type of assertion. - * @param actual The value to test. - * @param expected The expected value. - * @param message The error to throw if the assertion fails. - */ - public static assert<T>(type: AssertTypeEqual, actual: unknown, expected: T, message: Error): asserts actual is T; - public static assert<T>(type: AssertTypeNotEqual, actual: unknown, expected: T, message: Error): void; - public static assert(type: AssertType, actual: unknown, expected: unknown, message: Error): void { - assert[type](actual, expected, message); - } } -export type AssertTypeEqual = 'deepEqual' | 'deepStrictEqual' | 'equal' | 'strictEqual'; -export type AssertTypeNotEqual = 'notDeepEqual' | 'notDeepStrictEqual' | 'notEqual' | 'notStrictEqual'; -export type AssertType = AssertTypeEqual | AssertTypeNotEqual; - /** @typedef {PartialTextBasedChannelFields} vscodeDontDeleteMyImportTy */ |