00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ 00002 /* 00003 * mitie 00004 * Copyright (C) Jason Spencer 2009 <mitie@jasonspencer.org> 00005 * 00006 * mitie is free software: you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * mitie is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00014 * See the GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 class CjLog { 00022 static fstream s_file; 00023 static ostream s_stream; 00024 static unsigned int s_loglevel = 1; 00025 00026 static log(unsigned int loglevel, std::string message) { 00027 if(loglevel>=s_loglevel) { 00028 if(s_file && (s_file.good()) s_file << message; 00029 if(s_stream && (s_stream.good()) s_stream << message; 00030 } 00031 00032 } 00033 00034 static setSOutput(ostream * ost = 0) { 00035 00036 } 00037 00038 static setFOutput(char * filename = 0) { 00039 00040 00041 } 00042 00043 }; 00044 00045 #ifdef DO_MAIN 00046 int main(int, char **){ 00047 00048 00049 00050 } 00051 00052 00053 #define