00001 /**************************************************************************** 00002 ** $Id: alog.h,v 1.9 2007/06/02 07:07:08 app Exp $ 00003 ** 00004 ** Log functions header file of 00005 ** Ananas application library 00006 ** 00007 ** Created : 20051024 00008 ** 00009 ** Copyright (C) 2003-2005 Grigory Panov, Yoshkar-Ola. 00010 ** 00011 ** This file is part of the Designer application of the Ananas 00012 ** automation accounting system. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00021 ** 00022 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru 00023 ** See http://www.leaderit.ru/gpl/ for GPL licensing information. 00024 ** 00025 ** Contact org@leaderit.ru if any conditions of this licensing are 00026 ** not clear to you. 00027 ** 00028 **********************************************************************/ 00029 00030 #ifndef ALOG_H 00031 #define ALOG_H 00032 00033 //#include "ananas.h" 00034 #include "ananasglobal.h" 00035 #include <qstring.h> 00036 #include <qfile.h> 00037 00038 00039 // for bcc32.exe compatibility 00040 // in file wingdi.h 00041 // #define ERROR 0 00042 00043 //#ifdef Q_OS_WIN32 00044 //#define ERROR IRROR 00045 //#endif 00046 00054 class ANANAS_EXPORT aLog 00055 { 00056 public: 00057 enum MessageType { MT_ERROR, MT_INFO, MT_DEBUG }; 00058 // enum status { 00064 /* 00065 #ifdef Q_OS_WIN32 00066 static const int IRROR;//, 00067 #else 00068 static const int ERROR; 00069 #endif 00070 */ 00075 // static const int INFO;//, 00081 // static const int DEBUG;// }; 00082 00083 static void print( int status, const QString &text); 00084 static void printr( const QString &text); 00085 static void init( const QString &logname="", int loglevel=0); 00086 static void close(); 00087 static QString getLogName(); 00088 00089 00090 private: 00091 aLog(); 00092 static QString logName; 00093 static int logLevel; 00094 static QFile f; 00095 static bool msg_was_show; 00096 00097 }; 00098 #endif// ALOG_H