CategoryStream.cpp
Go to the documentation of this file.
00001 #include "CategoryStream.hpp"
00002 #include "Category.hpp"
00003 
00004 namespace OCL {
00005 namespace logging {
00006 
00007 CategoryStream::CategoryStream(Category* rt_category, log4cpp::Priority::Value priority) :
00008     _category(rt_category),
00009     _priority(priority)
00010 {
00011 
00012 }
00013  
00014 CategoryStream::~CategoryStream()
00015 {
00016     flush();
00017 }   
00018 
00019 void CategoryStream::flush()
00020 {
00021     _category->log(_priority, oss.str());
00022     oss.flush();
00023 }
00024 
00025 CategoryStream& eol(CategoryStream& os)
00026 {
00027     os.flush();
00028 
00029     return os;
00030 }
00031 
00032 CategoryStream::CategoryStream(const CategoryStream & rhs) :
00033     _category(rhs._category),
00034     _priority(rhs._priority)
00035 {
00036     // Must copy the underlying buffer but not the output stream
00037     (*this).oss.str(rhs.oss.str());
00038 }
00039 
00040 } // namespace logging
00041 } // namespace OCL
00042 


ocl
Author(s): OCL Development Team
autogenerated on Sun Nov 27 2016 03:45:30