From 34550246f497f252c1d7b1d505d0ce7fe7afc7bc Mon Sep 17 00:00:00 2001 From: Kevin Kuehler Date: Wed, 16 Jan 2019 00:43:10 -0800 Subject: [PATCH] lang: Add debug flag and Logf to fact init struct --- lang/funcs/facts/facts.go | 2 ++ lang/funcs/facts/func.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lang/funcs/facts/facts.go b/lang/funcs/facts/facts.go index 7a94bce6..9ea98ce5 100644 --- a/lang/funcs/facts/facts.go +++ b/lang/funcs/facts/facts.go @@ -68,6 +68,8 @@ type Init struct { //Noop bool Output chan types.Value // Stream must close `output` chan World engine.World + Debug bool + Logf func(format string, v ...interface{}) } // Fact is the interface that any valid fact must fulfill. It is very simple, diff --git a/lang/funcs/facts/func.go b/lang/funcs/facts/func.go index b8db9ef8..5abbe3b6 100644 --- a/lang/funcs/facts/func.go +++ b/lang/funcs/facts/func.go @@ -62,6 +62,8 @@ func (obj *FactFunc) Init(init *interfaces.Init) error { Hostname: init.Hostname, Output: init.Output, World: init.World, + Debug: init.Debug, + Logf: init.Logf, }, ) }