00001 00015 #pragma once 00016 00017 #include "LogLevel.h" 00018 #include "ILogPrinter.h" 00019 #include "Utils.h" 00020 00021 #include "TStd.h" 00022 #include <boost/utility.hpp> 00023 00024 namespace Nvidia { 00025 namespace Logging { 00026 00028 class LogInfo : private boost::noncopyable 00029 { 00030 private: 00032 long long m_timestamp; 00033 LogLevel m_level; 00034 const std::tstring& m_scopeLoggerName; 00035 std::tstring m_functionName; 00036 std::tstring m_fileName; 00037 int m_lineNumber; 00038 00039 public: 00041 LogInfo(LogLevel level, const std::tstring& scopeLoggerName, std::tstring functionName, std::tstring fileName, int lineNumber) : 00042 m_timestamp(Utils::GetCurrentTimestamp()), 00043 m_level(level), 00044 m_scopeLoggerName(scopeLoggerName), 00045 m_functionName(functionName), 00046 m_fileName(fileName), 00047 m_lineNumber(lineNumber) {} 00048 00049 long long GetAbsoluteTimestamp() const 00050 { 00051 return m_timestamp; 00052 } 00053 00054 long long GetRelativeTimestamp() const 00055 { 00056 return m_timestamp - Utils::GetFirstTimestamp(); 00057 } 00058 00059 LogLevel GetLevel() const 00060 { 00061 return m_level; 00062 } 00063 00064 const std::tstring& GetScopeLoggerName() const 00065 { 00066 return m_scopeLoggerName; 00067 } 00068 00069 const std::tstring& GetFunctionName() const 00070 { 00071 return m_functionName; 00072 } 00073 00074 const std::tstring& GetFileName() const 00075 { 00076 return m_fileName; 00077 } 00078 00079 int GetLineNumber() const 00080 { 00081 return m_lineNumber; 00082 } 00083 00084 }; 00085 00086 } 00087 }