/////////////////////////////////////////////////////////////////////////////// // Date: Sat Oct 13 18:01:33 CDT 2007 // Author: John Quigley // Revison: $Id$ // // The White Programming Language // Copyright (C) 2007 John Quigley // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . /////////////////////////////////////////////////////////////////////////////// #include #include #include #ifndef __UTIL_H__ #define __UTIL_H__ /////////////////////////////////////////////////////////////////////////////// // Logging facility typedef enum { Trace = 0, Debug = 1, Info = 2, Warn = 3, Error = 4 } LogLevel; #define LOGGER_TRACE(...) (_Logger_log(__FILE__, __LINE__, "[TRACE] ", __VA_ARGS__)) #define LOGGER_DEBUG(...) (_Logger_log(__FILE__, __LINE__, "[DEBUG] ", __VA_ARGS__)) #define LOGGER_INFO(...) (_Logger_log(__FILE__, __LINE__, "[INFO] " , __VA_ARGS__)) #define LOGGER_WARN(...) (_Logger_log(__FILE__, __LINE__, "[WARN] " , __VA_ARGS__)) #define LOGGER_ERROR(...) (_Logger_log(__FILE__, __LINE__, "[ERROR] ", __VA_ARGS__)) void _Logger_log(const char *file, const int line, const char *pre, const char *fmt, ...); #endif // __UTIL_H__ // EOF