#ifndef OpenTestSystem_OtxDiagManager_Common_ILog_H
#define OpenTestSystem_OtxDiagManager_Common_ILog_H

#include "CommonDefs.h"
#include <string>

namespace OpenTestSystem
{
	namespace OtxDiagManager
	{
		namespace Common
		{
			struct LogData;
			class ILogConfig;

			/// <summary>
			/// Log levels
			/// </summary>
			class COMMON_EXPORTS ILog
			{
			public:
				ILog(const std::string& module);
				virtual ~ILog();

				/// <summary>
				/// Log level
				/// </summary>
				enum Level {
					/// <summary>
					/// No logging
					/// </summary>
					off,
					/// <summary>
					/// ERROR
					/// </summary>
					error,
					/// <summary>
					/// CRITICAL
					/// </summary>
					critical,
					/// <summary>
					/// WARNING
					/// </summary>
					warning,
					/// <summary>
					/// INFO
					/// </summary>
					info,
					/// <summary>
					/// DEBUG
					/// </summary>
					debug,
					/// <summary>
					/// TRACE
					/// </summary>
					trace };

				void Log(Level level, const std::string& text);
				void Error(const std::string& text);
				void Critical(const std::string& text);
				void Warning(const std::string& text);
				void Info(const std::string& text);
				void Debug(const std::string& text);
				void Trace(const std::string& text);

			private:
				void CheckLevel();
				LogData* _data;
			};
		}
	}
}
#endif // OpenTestSystem_OtxDiagManager_Common_ILog_H
