nornir-automation / nornir

Pluggable multi-threaded framework with inventory management to help operate collections of devices
https://nornir.readthedocs.io/
Apache License 2.0
1.38k stars 234 forks source link

[Help] How to add task result into logging file #724

Closed xiaopeng163 closed 2 years ago

xiaopeng163 commented 2 years ago

for example, I have a task to execute one show command, and I got logging like below

2021-10-12 22:54:23,675 - nornir.core.task -    DEBUG -      start() - Host 'r1249': running task '[pre-check] - show run interface GigabitEthernet2/8'

from print_result, I got the output like below

---- [pre-check] - show run interface GigabitEthernet2/8 ** changed : False ---- INFO
Building configuration...

Current configuration : 217 bytes
!
interface GigabitEthernet2/8
 description peng xiao test
 no ip address
 logging event link-status
 shutdown
 udld port
 no mdix auto
 no cdp enable
 spanning-tree portfast edge
 spanning-tree bpduguard enable
end

so how can I add the print_result output into the logging file?