#ifndef OpenTestSystem_OtxDiagManager_Common_LogConfigBase_H
#define OpenTestSystem_OtxDiagManager_Common_LogConfigBase_H

#include "CommonDefs.h"

#include <mutex>

#include "ILog.h"
#include "ILogConfig.h"

namespace OpenTestSystem
{
	namespace OtxDiagManager
	{
		namespace Common
		{
			/// <summary>
			/// DiagManager default logger configuration
			/// </summary>
			class COMMON_EXPORTS LogConfigBase :
				public ILogConfig
			{
			public:
				LogConfigBase();
				virtual ~LogConfigBase();
				/// <summary>
				/// Gets the log level of a given module
				/// </summary>
				/// <returns>Log level of the given module</returns>
				ILog::Level GetLevel(const std::string& module) override;
				/// <summary>
				/// Sets the log level of a given module
				/// </summary>
				/// <param name="module">Name of the related module, e.g. 'VwMcd90DiagRuntimeSystem'</param>
				/// <param name="level">Log level</param>
				void SetLevel(const std::string& module, ILog::Level level) override;
				/// <summary>
				/// Sets the default log level
				/// </summary>
				/// <param name="level">Default log level</param>
				void SetDefaultLevel(ILog::Level level);

			private:
				std::map<std::string, ILog::Level> _levels;
				ILog::Level _defaultLevel;
				std::mutex _mutex;
			};
		}
	}
}
#endif // OpenTestSystem_OtxDiagManager_Common_LogConfigBase_H
