64 openLog(iLogFilename, iLogMode);
73 for (TProxyList::iterator pit = proxyList_.begin(); pit != proxyList_.end(); ++pit)
88 proxyList_.push_back(LASS_ENFORCE_POINTER(iProxy));
89 iProxy->
add(&logFile_, iFilter);
99 proxyList_.remove(LASS_ENFORCE_POINTER(iProxy));
100 iProxy->
remove(&logFile_);
111 return (LASS_ENFORCE_POINTER(iProxy))->filter(&logFile_);
123 (LASS_ENFORCE_POINTER(iProxy))->
setFilter(&logFile_, iFilter);
137void Logger::openLog(
const std::string &iLogFilename, LogMode iLogMode)
139 if (logFile_.is_open())
141 LASS_THROW(
"There's already an open log file! Can't open new one ...");
144 std::ios::openmode mode = std::ios::out;
145 mode |= (iLogMode == lmAppend) ? std::ios::app : std::ios::trunc;
147 logFile_.open(iLogFilename.c_str(), mode);
149 if (!logFile_.is_open())
151 LASS_THROW(
"Could not open log file '" << iLogFilename <<
"'");
void setFilter(ProxyOStream *iProxy, TMask iFilter)
Set filter between proxy and logger.
void unsubscribeTo(ProxyOStream *iProxy)
Unsubscribe this logger to a proxy stream.
TMask filter(ProxyOStream *iProxy)
return the filter between proxy and logger
~Logger()
Unsubscribe to all proxys.
void subscribeTo(ProxyOStream *iProxy, TMask iFilter=ProxyOStream::acceptAll)
Subscribe this logger to a proxy stream and set the filter on it.
Logger(const std::string &iLogFile, LogMode iLogMode=lmClear)
Default constructor for the sake of static library.
A proxy output stream can distribute output to multiple destination streams.
void add(std::ostream *destination, TMask filterMask=acceptAll)
Add a std::ostream to the list of destination streams.
void remove(std::ostream *destination)
Remove a std::ostream from the list of destination streams.
streams, binary streams, vrmlstreams, ...
Library for Assembled Shared Sources.