Skip to content

Commit 54ecd1f

Browse files
committed
review
1 parent ec385ec commit 54ecd1f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/logger.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ interface LoggerWithLogMethod extends Logger {
3333
export interface Logger extends BaseLogger {
3434
/**
3535
* Create a child logger.
36-
* This child will apply the methodFactory of the parent. So any log extensions applied to the parent
36+
*
37+
* This child will use the `methodFactory` of the parent, so any log extensions applied to the parent
3738
* at the time of calling `getChild` will be applied to the child as well.
38-
* It will NOT apply changes to the parents methodFactory after the child was created.
39-
* Those changes will not be applied manually to the child.
39+
* It will NOT apply changes to the parent's `methodFactory` after the child was created.
40+
* Those changes need to be applied to the child manually.
4041
*
4142
* @param namespace - name to add to the current logger to generate the child. Some implementations of `Logger`
4243
* use this as a prefix; others use a different mechanism.
@@ -142,11 +143,11 @@ function getPrefixedLogger(prefix?: string): PrefixedLogger {
142143
prefixLogger.getChild = (childPrefix): Logger => {
143144
// create the new child logger
144145
const childLogger = getPrefixedLogger((prefix ?? "") + childPrefix);
145-
// assign the same methodFactory as the root logger.
146-
// this is useful if we add extensions to the root logger that modify
147-
// its methodFactory. (an example extension is: storing each log to a rageshake db)
146+
// Assign the methodFactory from the parent logger.
147+
// This is useful if we add extensions to the parent logger that modifies
148+
// its methodFactory. (An example extension is: storing each log to a rageshake db)
148149
childLogger.methodFactory = prefixLogger.methodFactory;
149-
// rebuild the child logger with the new methodFactory.
150+
// Rebuild the child logger with the new methodFactory.
150151
childLogger.rebuild();
151152
return childLogger;
152153
};

0 commit comments

Comments
 (0)