@@ -33,10 +33,11 @@ interface LoggerWithLogMethod extends Logger {
33
33
export interface Logger extends BaseLogger {
34
34
/**
35
35
* 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
37
38
* 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 .
40
41
*
41
42
* @param namespace - name to add to the current logger to generate the child. Some implementations of `Logger`
42
43
* use this as a prefix; others use a different mechanism.
@@ -142,11 +143,11 @@ function getPrefixedLogger(prefix?: string): PrefixedLogger {
142
143
prefixLogger . getChild = ( childPrefix ) : Logger => {
143
144
// create the new child logger
144
145
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)
148
149
childLogger . methodFactory = prefixLogger . methodFactory ;
149
- // rebuild the child logger with the new methodFactory.
150
+ // Rebuild the child logger with the new methodFactory.
150
151
childLogger . rebuild ( ) ;
151
152
return childLogger ;
152
153
} ;
0 commit comments