logger.cpp

00001 /***************************************************************************
00002                           logger.cpp  -  description
00003                              -------------------
00004     begin                : Son Okt 19 2003
00005     copyright            : (C) 2003 by Eggert Ehmke
00006     email                : eggert.ehmke@berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include <kstandarddirs.h>
00019 // #include <kdebug.h>
00020 #include "logger.h"
00021 
00022 QTextStream* Logger::logstream = NULL;
00023 QFile Logger::logfile;
00024 
00025 Logger::~Logger()
00026 {
00027   delete logstream;
00028 }
00029 
00030 QTextStream& Logger ()
00031 {
00032   if (Logger::logstream == NULL)
00033   {
00034     QString logfilename = locateLocal ("data", "kshowmail/kshowmail.log");
00035     Logger::logfile.setName (logfilename);
00036     Logger::logfile.open (IO_WriteOnly | IO_Append);
00037     Logger::logstream = new QTextStream (&Logger::logfile);
00038   }
00039   return *Logger::logstream;  
00040 }
00041 
00042 void Logger::flush()
00043 {
00044   logfile.flush();
00045 }
00046 

Generated on Thu Jul 5 19:36:07 2007 for kshowmail by  doxygen 1.5.0