File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
src/oxl_opnsense_client/basic Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def exit_json(data: dict):
6767 raise NotImplemented
6868
6969 def warn (self , msg : str ):
70- self ._module_input .c .warn (msg )
70+ self ._module_input .c .debug_or_warn (msg )
7171
7272 def fail_json (self , msg : str ):
7373 self ._module_input .c .fail (msg )
Original file line number Diff line number Diff line change @@ -198,9 +198,19 @@ def warn(self, msg: str):
198198 else :
199199 print (f"WARN: { msg } " )
200200
201- @staticmethod
202- def info (msg : str ):
203- print (f"INFO: { msg } " )
201+ def info (self , msg : str ):
202+ if self .shell :
203+ print (f"\x1b [1;34mINFO: { msg } \x1b [0m\n " )
204+
205+ else :
206+ print (f"INFO: { msg } " )
207+
208+ def debug_or_warn (self , msg : str ):
209+ if self .debug :
210+ self .info (msg )
211+
212+ else :
213+ self .warn (msg )
204214
205215 def __enter__ (self ):
206216 return self
You can’t perform that action at this time.
0 commit comments