Skip to content

Commit d55e556

Browse files
committed
Add WithDebugLogging option
Signed-off-by: Evan Lezar <[email protected]>
1 parent 19dfc82 commit d55e556

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/discover/hooks.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type hookCreatorOptions struct {
8989
nvidiaCDIHookPath string
9090
disabledHooks []HookName
9191
enabledHooks []HookName
92+
debugLogging bool
9293
}
9394

9495
type Option func(*hookCreatorOptions)
@@ -114,6 +115,12 @@ type HookCreator interface {
114115
Create(HookName, ...string) *Hook
115116
}
116117

118+
func WithDebugLogging(debugLogging bool) Option {
119+
return func(hco *hookCreatorOptions) {
120+
hco.debugLogging = debugLogging
121+
}
122+
}
123+
117124
// WithDisabledHooks explicitly disables the specified hooks.
118125
// This can be specified multiple times.
119126
func WithDisabledHooks(hooks ...HookName) Option {
@@ -164,6 +171,7 @@ func NewHookCreator(opts ...Option) HookCreator {
164171
nvidiaCDIHookPath: o.nvidiaCDIHookPath,
165172
disabledHooks: disabledHooks,
166173
fixedArgs: getFixedArgsForCDIHookCLI(o.nvidiaCDIHookPath),
174+
debugLogging: o.debugLogging,
167175
}
168176

169177
return c

0 commit comments

Comments
 (0)