1+ import { createLogger } from "./logger" ;
12import { NormalizedConfig } from "./normalizer" ;
23import { resolveStrategies } from "./strategy-resolver" ;
34import { StrategyFn , StrategyResult , StrategyStatus } from "./types" ;
@@ -59,6 +60,7 @@ interface MergeArgs<TContext> {
5960 filePath ?: string ;
6061 ctx : MergeContext < TContext > ;
6162 conflicts : Conflict [ ] ;
63+ logger : Awaited < ReturnType < typeof createLogger > > ;
6264}
6365
6466/** Utility: plain-object check. */
@@ -105,7 +107,7 @@ export const BuiltInStrategies = {
105107 } ,
106108
107109 merge : async < TContext > ( args : MergeArgs < TContext > ) : Promise < StrategyResult > => {
108- const { ours, theirs, base, path, filePath, ctx, conflicts } = args ;
110+ const { ours, theirs, base, path, filePath, ctx, conflicts, logger } = args ;
109111
110112 // Plain objects
111113 if ( isPlainObject ( ours ) && isPlainObject ( theirs ) ) {
@@ -120,6 +122,7 @@ export const BuiltInStrategies = {
120122 filePath,
121123 ctx,
122124 conflicts,
125+ logger,
123126 } ) ;
124127 }
125128 return { status : StrategyStatus_OK , value : result } ;
@@ -164,6 +167,7 @@ export const mergeObject = async <TContext>({
164167 filePath,
165168 ctx,
166169 conflicts,
170+ logger,
167171} : MergeArgs < TContext > ) : Promise < unknown > => {
168172 if ( ours === theirs ) return ours ;
169173
@@ -175,6 +179,8 @@ export const mergeObject = async <TContext>({
175179 ctx . _strategyCache . set ( path , strategies ) ;
176180 }
177181
182+ logger . debug ( filePath ?? "all" , `path: ${ path } , strategies: ${ strategies . join ( ", " ) || "none" } ` ) ;
183+
178184 for ( const strategy of strategies ) {
179185 const fn = ( BuiltInStrategies as any ) [ strategy ] ?? ctx . strategies [ strategy ] ;
180186
@@ -188,6 +194,7 @@ export const mergeObject = async <TContext>({
188194 filePath,
189195 ctx,
190196 conflicts,
197+ logger,
191198 } ) ;
192199
193200 switch ( result . status ) {
0 commit comments