Changeset 5908 for branches/newapi
- Timestamp:
- 12/02/07 20:04:42 (12 months ago)
- Location:
- branches/newapi/licq/src
- Files:
-
- 1 added
- 2 modified
-
static.cpp (added)
-
util/log.cpp (modified) (2 diffs)
-
util/log.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/newapi/licq/src/util/log.cpp
r5896 r5908 19 19 20 20 #include "licq/interface/logsink.h" 21 #include "licq/thread/threadspecific.h"22 21 #include "util/log.h" 23 #include "util/tr.h"24 22 25 23 #include <cassert> … … 27 25 #include <time.h> 28 26 29 static Licq::ThreadSpecific<LicqDaemon::Log> ThreadLogs;30 31 27 LicqDaemon::Log::Log(const std::string& owner, Licq::LogSink* sink) 32 28 : myOwner(owner), mySink(sink) 33 29 { 34 30 assert(mySink != NULL); 35 }36 37 void LicqDaemon::Log::setThreadLog(const Log* log)38 {39 if (ThreadLogs.hasData())40 {41 ThreadLogs.getData()->fatal() <<42 tr("LicqDaemon::Log::setThreadLog called more than once");43 ::abort();44 }45 ThreadLogs.setData(log);46 }47 48 LicqDaemon::Log* LicqDaemon::Log::getThreadLog()49 {50 assert(ThreadLogs.hasData());51 return ThreadLogs.getData();52 31 } 53 32 -
branches/newapi/licq/src/util/log.h
r5896 r5908 51 51 * @see getThreadLog() 52 52 */ 53 static void setThreadLog(const Log* log); 54 55 /** 56 * @returns The default log for the calling thread. setThreadLog() 57 * must have been called by the calling thread before calling this 58 * method. 59 * 60 * @see setThreadLog() 61 */ 62 static Log* getThreadLog(); 53 static void setThreadLog(const Licq::Log* log); 63 54 64 55 // From Licq::Log
