Closed weiyuan-jiang closed 4 years ago
The other change to this PR that somehow did not make it into the review:
We need two types of Handler containers. The first uses ALLOCATABLE (as per the original code), and the other uses POINTER (as per how this PR has done it). LoggerManager should have a HandlerVector, and Logger's should have HandlerPtrVector's.
This will prevent a memory leak when the LoggerManager goes out of scope.
LoggerManager has a handleMap which uses allocatable. So We don't need to worry about it.
@tclune I have made some minor changes and tested it with the logging.yaml posted by Ben. It works.
Move shared resource to LoggerManager and free resources through LoggerManager instead of through individual logger