Skip to content

Commit a693494

Browse files
committed
docs: enhance IterableLogger documentation with descriptions and examples
1 parent 307326e commit a693494

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

src/core/classes/IterableLogger.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export class IterableLogger {
3737
static loggingEnabled = DEFAULT_LOGGING_ENABLED;
3838

3939
/**
40-
* The level of logging to show in the developer console.
40+
* The level of logging.
41+
*
42+
* This controls which logs will show when using the {@link IterableLogger.error}, {@link IterableLogger.debug}, and {@link IterableLogger.info} methods.
4143
*/
4244
static logLevel = DEFAULT_LOG_LEVEL;
4345

@@ -67,6 +69,11 @@ export class IterableLogger {
6769
* Logs a message to the console if logging is enabled.
6870
*
6971
* @param message - The message to be logged.
72+
*
73+
* @example
74+
* ```typescript
75+
* IterableLogger.log('I will show if logging is enabled');
76+
* ```
7077
*/
7178
static log(message?: unknown, ...optionalParams: unknown[]) {
7279
if (!IterableLogger.loggingEnabled) return;
@@ -75,9 +82,14 @@ export class IterableLogger {
7582
}
7683

7784
/**
78-
* Logs a message to the console if the log level is error.
85+
* Logs a message to the console if the log level is {@link IterableLogLevel.error}.
7986
*
8087
* @param message - The message to be logged.
88+
*
89+
* @example
90+
* ```typescript
91+
* IterableLogger.error('I will only show if the log level is error and logging is enabled');
92+
* ```
8193
*/
8294
static error(message?: unknown, ...optionalParams: unknown[]) {
8395
if (!IterableLogger.loggingEnabled) return;
@@ -87,9 +99,15 @@ export class IterableLogger {
8799
}
88100

89101
/**
90-
* Logs a message to the console if the log level is debug or lower.
102+
* Logs a message to the console if the log level is {@link IterableLogLevel.debug} or lower.
91103
*
92104
* @param message - The message to be logged.
105+
*
106+
* @example
107+
* ```typescript
108+
* IterableLogger.debug('I will show if the log level is debug and logging is enabled');
109+
* IterableLogger.debug('I will also show if the log level is error and logging is enabled');
110+
* ```
93111
*/
94112
static debug(message?: unknown, ...optionalParams: unknown[]) {
95113
if (!IterableLogger.loggingEnabled) return;
@@ -104,9 +122,16 @@ export class IterableLogger {
104122
}
105123

106124
/**
107-
* Logs a message to the console if the log level is info or lower.
125+
* Logs a message to the console if the log level is {@link IterableLogLevel.info} or lower.
108126
*
109127
* @param message - The message to be logged.
128+
*
129+
* @example
130+
* ```typescript
131+
* IterableLogger.info('I will show if the log level is info and logging is enabled');
132+
* IterableLogger.info('I will also show if the log level is debug and logging is enabled');
133+
* IterableLogger.info('I will also show if the log level is error and logging is enabled');
134+
* ```
110135
*/
111136
static info(message?: unknown, ...optionalParams: unknown[]) {
112137
if (!IterableLogger.loggingEnabled) return;

0 commit comments

Comments
 (0)