opensurgsim
Classes | Functions
LoggerManagerTest.cpp File Reference

Tests for LoggerManager class. More...

#include "SurgSim/Framework/Log.h"
#include <string>
#include <memory>
#include <gtest/gtest.h>

Classes

class  MockOutput
 

Functions

 TEST (LoggerManagerTest, Constructor)
 
 TEST (LoggerManagerTest, DefaultOutput)
 
 TEST (LoggerManagerTest, DefaultLoggerTest)
 
 TEST (LoggerManagerTest, GetLogger)
 
 TEST (LoggerManagerTest, Threshold)
 

Detailed Description

Tests for LoggerManager class.

Function Documentation

§ TEST() [1/2]

TEST ( LoggerManagerTest  ,
GetLogger   
)

getLogger() will create a new logger if a logger with given name is not found

getLogger() guarantees to return a logger with given name

§ TEST() [2/2]

TEST ( LoggerManagerTest  ,
Threshold   
)

Check default log level

setThreshold(level) will change log level of existing loggers and the default log level

setThreshold(level) will affect log level of newly created loggers

setThreshold(pattern, level) will change log level of existing loggers which match given name pattern Logger with different pattern will not be changed Default log level will not be affected

setThreshold(pattern, level) will affect newly created loggers if the logger's name matches the pattern

Logger manager should own the logger.