srl-labs / clabernetes

containerlab, but in kubernetes!
BSD 3-Clause "New" or "Revised" License
60 stars 9 forks source link

Clabverter : ensure deletion of the old clabverter logging instance before creating a new one #148

Closed outout14 closed 5 months ago

outout14 commented 5 months ago

Hi,

When using Clabverter as a Golang module, we need to use the MustNewClabverter() function to create a new clabverter instance. The functions calls MustRegisterAndGetLogger() that panics if a logging instance of clabverter already exists.

This PR patches the MustNewClabverter by checking if the logging instance already exists. If so, it get destroyed and recreated.

carlmontanari commented 5 months ago

lgtm, thanks @outout14 😎