summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Michaelsen <b_michaelsen@openoffice.org>2009-10-14 13:40:00 +0000
committerBjörn Michaelsen <b_michaelsen@openoffice.org>2009-10-14 13:40:00 +0000
commit0c9f311b9ea1b74dceee3f2806527cad1e9ba999 (patch)
treeaf160f73452b170b5d8463780e5d7a56ae10ec76
parenta79a4812e4cec0a2a0711279b20af5a0f6631838 (diff)
#i105835# logging::Filehandler::flush flushes, logging::Logger::publish flushes all handlers
-rw-r--r--extensions/source/logging/filehandler.cxx11
-rw-r--r--extensions/source/logging/logger.cxx2
2 files changed, 12 insertions, 1 deletions
diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx
index 97d6d7524290..e04ea8faf0be 100644
--- a/extensions/source/logging/filehandler.cxx
+++ b/extensions/source/logging/filehandler.cxx
@@ -328,7 +328,16 @@ namespace logging
void SAL_CALL FileHandler::flush( ) throw (RuntimeException)
{
MethodGuard aGuard( *this );
- // nothing to do, our ::osl::File implementation is not buffered
+ if(!m_pFile.get())
+ {
+ OSL_PRECOND(false, "FileHandler::flush: no file!");
+ return;
+ }
+ #if OSL_DEBUG_LEVEL > 0
+ ::osl::FileBase::RC res =
+ #endif
+ m_pFile->sync();
+ OSL_ENSURE(res == ::osl::FileBase::E_None, "FileHandler::flush: Could not sync logfile to filesystem.");
}
//--------------------------------------------------------------------
diff --git a/extensions/source/logging/logger.cxx b/extensions/source/logging/logger.cxx
index 69ae5fced483..66e0eb540ef0 100644
--- a/extensions/source/logging/logger.cxx
+++ b/extensions/source/logging/logger.cxx
@@ -230,6 +230,8 @@ namespace logging
m_aHandlers.forEach< XLogHandler >(
::boost::bind( &XLogHandler::publish, _1, ::boost::cref( _rRecord ) ) );
+ m_aHandlers.forEach< XLogHandler >(
+ ::boost::bind( &XLogHandler::flush, _1 ) );
}
//--------------------------------------------------------------------