Página principal | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

Log.cpp

Ir a la documentación de este archivo.
00001 
00006 /*
00007    MUnDoCAAD MUD Engine
00008    Copyright (C) 2002-2005 José Manuel Ferrer Ortiz
00009 
00010    *****************************************************************************
00011    *                                                                           *
00012    *  This program is free software; you can redistribute it and/or modify it  *
00013    *  under the terms of the GNU General Public License version 2, as          *
00014    *  published by the Free Software Foundation.                               *
00015    *                                                                           *
00016    *  This program is distributed in the hope that it will be useful, but      *
00017    *  WITHOUT ANY WARRANTY; without even the implied warranty of               *
00018    *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU         *
00019    *  General Public License version 2 for more details.                       *
00020    *                                                                           *
00021    *  You should have received a copy of the GNU General Public License        *
00022    *  version 2 along with this program; if not, write to the Free Software    *
00023    *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  *
00024    *                                                                           *
00025    *****************************************************************************
00026 */
00027 
00028 
00029 #include <cstdlib>  // Para exit
00030 
00031 #include "Log.hpp"
00032 #include "config.hpp"
00033 
00034 
00035 FILE          *fichero_log = stdout;
00036 unsigned char prolijidad   = NIVEL_PROLIJIDAD;
00037 
00038 
00040 
00043 void ManejadorMensajes (const QtMsgType tipo, const char *mensaje)
00044 {
00045   switch (tipo)
00046   {
00047     case QtDebugMsg:
00048 #ifdef QT_DEBUG
00049       Log (8, QString ("Depuración: ") + mensaje + "\n");
00050 #endif  // QT_DEBUG
00051       break;
00052     case QtWarningMsg:
00053       Log (9, QString ("Advertencia: ") + mensaje + "\n");
00054       break;
00055     case QtFatalMsg:
00056       Log (10, QString ("ERROR: ") + mensaje + "\n");
00057       exit (-1);
00058     default:
00059       Log (10, QString ("Error: ") + mensaje + "\n");
00060   }
00061 }
00062 
00064 void Log (const unsigned char gravedad, const QString &mensaje)
00065 {
00066   if ((10 - prolijidad) <= gravedad)
00067     fprintf (fichero_log, "%s", mensaje.toLatin1().constData());
00068 }

Generado el Tue Nov 29 01:04:33 2005 para MUnDoCAAD MUD Engine por  doxygen 1.4.4