Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 6c152d8

Browse files
committed
fixed typos
1 parent 7d92c83 commit 6c152d8

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

packages/logger/src/logger.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class Logger {
114114
* if all specified tags are allowed to be logged.
115115
*
116116
* @public
117-
* @param tags - Tags required to perform the following action.
117+
* @param tags - Tags required to be allowed to perform the following action.
118118
*/
119119
tag: (tags: string[]) => this.tag(tags),
120120
};
@@ -125,7 +125,7 @@ export class Logger {
125125
* if all specified tags are allowed to be logged.
126126
*
127127
* @internal
128-
* @param tags - Tags required to perform the following action.
128+
* @param tags - Tags required to be allowed to perform the following action.
129129
*/
130130
private tag(tags: string[]): DefaultLogMethodsInterface {
131131
return this.logIfCondition(includesArray(this.config.allowedTags, tags));
@@ -145,7 +145,7 @@ export class Logger {
145145
Logger.level
146146
).map((loggerCategory) => loggerCategory.toLowerCase());
147147

148-
// Build object based on the default log categories
148+
// Build object representing the default log categories
149149
const finalObject: DefaultLogMethodsInterface = {} as any;
150150
for (const loggerCategory of defaultLoggerCategories) {
151151
finalObject[loggerCategory] = condition
@@ -266,7 +266,7 @@ export class Logger {
266266
* @internal
267267
* @param data - Data to be logged.
268268
* @param loggerCategoryKey - Key/Name identifier of the Logger category.
269-
* @param consoleLogType - What type of log to be logged (console[consoleLogType]).
269+
* @param consoleLogType - What type of log to invoke the console with (console[consoleLogType]).
270270
*/
271271
private invokeConsole(
272272
data: any[],
@@ -290,7 +290,7 @@ export class Logger {
290290
return prefix;
291291
};
292292

293-
// Add built log prefix to the data array
293+
// Add created log prefix to the data array
294294
if (typeof data[0] === 'string')
295295
data[0] = buildPrefix().concat(' ').concat(data[0]);
296296
else data.unshift(buildPrefix());
@@ -354,7 +354,7 @@ export class Logger {
354354
* If the to retrieve Logger category doesn't exist, `undefined` is returned.
355355
*
356356
* @public
357-
* @param categoryKey - Key/Name identifier of the Item.
357+
* @param categoryKey - Key/Name identifier of the Logger category.
358358
*/
359359
public getLoggerCategory(categoryKey: LoggerCategoryKey) {
360360
return this.loggerCategories[categoryKey];
@@ -364,7 +364,7 @@ export class Logger {
364364
* Fires on each logged message of the Logger.
365365
*
366366
* @public
367-
* @param callback - A function to be executed on each logged message of the Logger..
367+
* @param callback - A function to be executed on each logged message of the Logger.
368368
* @param config - Configuration object
369369
*/
370370
public watch(
@@ -383,10 +383,11 @@ export class Logger {
383383
}
384384

385385
/**
386-
* Assigns the specified level to the Logger.
386+
* Assigns the specified log level to the Logger.
387387
*
388-
* The Logger level determines which log types can be logged.
389-
* By default, the logger supports a number of levels, which are represented in 'Logger.level'.
388+
* The Logger level determines which Logger categories (log message types) can be logged.
389+
* By default, the logger supports a various number of levels,
390+
* which are represented in 'Logger.level'.
390391
*
391392
* @public
392393
* @param level - Level
@@ -469,12 +470,6 @@ export type ConsoleLogType =
469470
| 'info'
470471
| 'debug';
471472

472-
/**
473-
* @param key - Key/Name of Logger Category
474-
* @param customStyle - Css Styles that get applied to the Logs
475-
* @param prefix - Prefix that gets written before each Log of this Category
476-
* @param level - Until which Level this Logger Category gets logged
477-
*/
478473
export interface LoggerCategoryInterface {
479474
/**
480475
* Key/Name identifier of the Logger category.
@@ -528,7 +523,7 @@ export type LoggerWatcherCallback = (
528523

529524
export interface LoggerWatcherConfigInterface {
530525
/**
531-
* Callback method to be executed on each log action.
526+
* Callback method to be fired on each log action.
532527
*/
533528
callback: LoggerWatcherCallback;
534529
/**

packages/logger/src/shared.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@agile-ts/utils';
2-
import { Logger, LoggerConfig } from './logger';
2+
import { CreateLoggerConfigInterface, Logger } from './logger';
33

44
export const defaultSharedLoggerConfig = {
55
prefix: 'Agile',
@@ -24,9 +24,12 @@ export function assignSharedLogger(logger: Logger): void {
2424
/**
2525
* Returns a newly created Logger.
2626
*
27+
* The Logger is a practical class for handling advanced logging
28+
* with e.g. different types of logs or filtering.
29+
*
2730
* @param config - Configuration object
2831
*/
29-
export function createLogger(config: LoggerConfig = {}): Logger {
32+
export function createLogger(config: CreateLoggerConfigInterface = {}): Logger {
3033
config = defineConfig(config, defaultSharedLoggerConfig);
3134
return new Logger(config);
3235
}

0 commit comments

Comments
 (0)