00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _DECAF_UTIL_LOGGING_LOGRECORD_H_
00018 #define _DECAF_UTIL_LOGGING_LOGRECORD_H_
00019
00020 #include <decaf/lang/Throwable.h>
00021 #include <decaf/util/logging/LoggerCommon.h>
00022 #include <decaf/util/logging/Level.h>
00023 #include <decaf/util/Config.h>
00024
00025 #include <memory>
00026 #include <string>
00027
00028 namespace decaf{
00029 namespace util{
00030 namespace logging{
00031
00041 class DECAF_API LogRecord {
00042 private:
00043
00044
00045 Level level;
00046
00047
00048 std::string loggerName;
00049
00050
00051 std::string sourceFile;
00052
00053
00054 unsigned int sourceLine;
00055
00056
00057 std::string message;
00058
00059
00060 std::string functionName;
00061
00062
00063 long long timeStamp;
00064
00065
00066 long long threadId;
00067
00068
00069 std::auto_ptr<decaf::lang::Throwable> thrown;
00070
00071 public:
00072
00073 LogRecord();
00074
00075 virtual ~LogRecord();
00076
00081 Level getLevel() const {
00082 return level;
00083 };
00084
00089 void setLevel( Level value ) {
00090 level = value;
00091 };
00092
00097 const std::string& getLoggerName() const {
00098 return loggerName;
00099 };
00100
00105 void setLoggerName( const std::string& loggerName ) {
00106 this->loggerName = loggerName;
00107 };
00108
00113 const std::string& getSourceFile() const {
00114 return sourceFile;
00115 };
00116
00121 void setSourceFile( const std::string& sourceFile ) {
00122 this->sourceFile = sourceFile;
00123 };
00124
00129 unsigned int getSourceLine() const {
00130 return sourceLine;
00131 };
00132
00137 void setSourceLine( unsigned int sourceLine ) {
00138 this->sourceLine = sourceLine;
00139 };
00140
00145 const std::string& getMessage() const {
00146 return message;
00147 };
00148
00153 void setMessage( const std::string& message ) {
00154 this->message = message;
00155 };
00156
00161 const std::string& getSourceFunction() const {
00162 return functionName;
00163 };
00164
00169 void setSourceFunction( const std::string& functionName ) {
00170 this->functionName = functionName;
00171 };
00172
00177 long long getTimestamp() const { return timeStamp; };
00178
00183 void setTimestamp( long long timeStamp ) {
00184 this->timeStamp = timeStamp;
00185 };
00186
00191 long long getTreadId() const {
00192 return threadId;
00193 };
00194
00199 void setTreadId( long long threadId ) {
00200 this->threadId = threadId;
00201 };
00202
00207 decaf::lang::Throwable* getThrown() const {
00208 return this->thrown.get();
00209 }
00210
00219 void setThrown( decaf::lang::Throwable* thrown ) {
00220 this->thrown.reset( thrown );
00221 }
00222
00223 };
00224
00225 }}}
00226
00227 #endif