Skip to content

Commit

Permalink
Update TS docs for 'LogOptions'.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Feb 29, 2024
1 parent d18a4b4 commit 3a0dc26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 19 additions & 4 deletions packages/realm/src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,18 @@ export enum LogCategory {
}

/**
* Type for `Realm.setLogLevel`
* Log options to use when setting the log level.
*/
export type LogOptions = {
/**
* The log level to be used by the logger.
* @default "info"
*/
level: LogLevel;
/**
* The category to set the log level for. If omitted, the log level
* is set for all categories ({@link LogCategory.Realm}).
*/
category?: LogCategory;
};

Expand All @@ -172,13 +180,20 @@ export type LoggerCallback1 = (level: LogLevel, message: string) => void;
* Represents an entry in the log.
*/
export type LogEntry = {
/** The category (origin) of the log entry. */
/**
* The category (origin) of the log entry.
*/
category: LogCategory;
/** The level of the log entry. */
/**
* The level of the log entry.
*/
level: LogLevel;
/** The message of the log entry. */
/**
* The message of the log entry.
*/
message: string;
};

/**
* A callback passed to `Realm.setLogger`. Arguments are passed as an object.
* @since 12.7.0
Expand Down
2 changes: 0 additions & 2 deletions packages/realm/src/Realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ export class Realm {
/**
* Sets the log level for a specific category.
* @param options - The log options to use.
* @param options.level - The log level to be used by the logger. The default value is `info`.
* @param options.category - The category/component to set the log level for. If omitted, log level is set for all categories.
* @note The log level can be changed during the lifetime of the application.
* @since 12.7.0
* @example
Expand Down

0 comments on commit 3a0dc26

Please sign in to comment.