00001 /*************************************************************************** 00002 *Copyright (C) 2003 by Fco. Javier MC, Jean René Mérou, Víctor G. Marimón * 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License as published by * 00006 * the Free Software Foundation; either version 2 of the License, or * 00007 * (at your option) any later version. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License * 00015 * along with this program; if not, write to the * 00016 * Free Software Foundation, Inc., * 00017 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00018 ***************************************************************************/ 00019 #ifndef LOG_H 00020 #define LOG_H 00021 00022 #include <qstring.h> 00023 #include <iostream> 00024 #include <fstream> 00025 using namespace std; 00026 00027 #include "empresa.h" 00028 00029 // Estos tipos son utilizados para poder hacer los logs. Se determinan en la función add. 00030 #define LOG_SEG 1 // seguridad 00031 #define LOG_SIS 2 // sistema 00032 #define LOG_DBD 4 // de base de datos 00033 #define LOG_TRA 8 // trazado de usuarios 00034 // ... 8 bits -> ocho tipos de logs que se pueden complementar 00035 00036 00047 class bitacora { 00048 private: 00049 ofstream *archivolog; 00050 empresa *empresaactual; 00051 00052 public: 00053 bitacora(); 00054 void add(int , int, QString ,QString); 00055 void setempresa(empresa *emp) {empresaactual=emp;} 00056 ~bitacora(); 00057 }; 00058 00059 extern bitacora *ctllog; 00060 00061 #endif