From 90449bc745546f0f25bc93ee4b06d21b7c0210e8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 18 Feb 2024 08:01:22 -0500 Subject: Log update (#701) * Don't export Logger * Rename logger.js to log.js * Move helper function * Update extension name configuration * Simplify docs * Move issue URL to a field * Simplify context * Remove optional params that are never used * Configure backend * Update eslint * Simplify * Rename function * Simplify _api reference * Simplify docs * Remove unused log levels (except 'log') * Add log function * Rename for more clear intent * Use log.log --- types/ext/api.d.ts | 2 +- types/ext/log.d.ts | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'types') diff --git a/types/ext/api.d.ts b/types/ext/api.d.ts index 85f4c146..401cb1a5 100644 --- a/types/ext/api.d.ts +++ b/types/ext/api.d.ts @@ -289,7 +289,7 @@ type ApiSurface = { }; return: DictionaryDatabase.MediaDataStringContent[]; }; - log: { + logGenericErrorBackend: { params: { error: Core.SerializedError; level: Log.LogLevel; diff --git a/types/ext/log.d.ts b/types/ext/log.d.ts index 5b33b234..af906387 100644 --- a/types/ext/log.d.ts +++ b/types/ext/log.d.ts @@ -17,22 +17,14 @@ import type {EventNames, EventArgument as BaseEventArgument} from './core'; -export type LogLevel = 'log' | 'info' | 'debug' | 'warn' | 'error'; +export type LogLevel = 'log' | 'warn' | 'error'; export type LogContext = { url: string; }; -/** - * An enum representing the log error level. - * - `0` - _log_, _info_, _debug_ level. - * - `1` - _warn_ level. - * - `2` - _error_ level. - */ -export type LogErrorLevelValue = 0 | 1 | 2; - export type Events = { - log: { + logGenericError: { error: unknown; level: LogLevel; context: LogContext; -- cgit v1.2.3