Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Msg.h

Go to the documentation of this file.
00001 
00002 // $Id: Msg.h,v 1.12 2005/03/07 12:26:24 tagg Exp $
00003 //
00004 // Define some data types used by the message service
00005 //
00006 // messier@huhepl.harvard.edu
00008 #ifndef MSG_H
00009 #define MSG_H
00010 
00011 //......................................................................
00012 
00013 class Msg
00014 {
00015 public:
00016   //======================================================================
00017   // Define the various print levels for messages
00018   //======================================================================
00019   typedef int LogLevel_t;
00020   static const LogLevel_t kMinLogLevel = 0;
00021   static const LogLevel_t kVerbose     = 0;
00022   static const LogLevel_t kDebug       = 1;
00023   static const LogLevel_t kSynopsis    = 2;
00024   static const LogLevel_t kInfo        = 3;
00025   static const LogLevel_t kWarning     = 5;
00026   static const LogLevel_t kError       = 6;
00027   static const LogLevel_t kFatal       = 7;
00028   static const LogLevel_t kNLogLevel   = 8;
00029 
00030   //======================================================================
00031   // Define format flags for messages
00032   //======================================================================
00033   static const int kPriority = 0x01; // The message's priority (=I=, =E= etc..)
00034   static const int kName     = 0x02; // The stream's name
00035   static const int kTime     = 0x04; // A time stamp for the message
00036   static const int kFile     = 0x08; // The file the message came from
00037   static const int kCVSId    = 0x10; // CVS version information for the file
00038   static const int kLine     = 0x20; // Line number from the file
00039   static const int kHost     = 0x40; // Hostname
00040   static const int kPID      = 0x80; // Process ID
00041   static const int kRunSnarl = 0x100; // Run and snarl number
00042   static const int kStackTrace=0x200; // Add a stack trace on every message.
00043 
00044 
00045   // Colors!
00046   static const int kColorAll  =0x1000;
00047   static const int kBold      =0x2000;
00048   static const int kDim       =0x4000;
00049   static const int kUnderline =0x8000;
00050   static const int kBlink     =0x10000;
00051   static const int kReverse   =0x20000;
00052 
00053   static const int kBlack     =0x100000;   
00054   static const int kRed       =0x200000;
00055   static const int kGreen     =0x300000;
00056   static const int kYellow    =0x400000;
00057   static const int kBlue      =0x500000;
00058   static const int kMagenta   =0x600000;
00059   static const int kCyan      =0x700000;
00060   static const int kWhite     =0x800000;
00061   static const int kBgBlack   =0x1000000;
00062   static const int kBgRed     =0x2000000;
00063   static const int kBgGreen   =0x3000000;
00064   static const int kBgYellow  =0x4000000;
00065   static const int kBgBlue    =0x5000000;
00066   static const int kBgMagenta =0x6000000;
00067   static const int kBgCyan    =0x7000000;
00068   static const int kBgWhite   =0x8000000;
00069   
00070 
00071   static const int kFgColorMask =0xF00000;   // Foreground color mask
00072   static const int kBgColorMask =0xF000000;  // BG color mask.
00073 
00074   static const int kFontMask = 0xFFF0000; // Mask out all color bits.
00075 
00076   static LogLevel_t GetLevelCode(const char *level);
00077   static const char* LevelAsString(int level);
00078   static int        GetFormatCode(const char *fmt);
00079 private:
00080   Msg(); // No instances allowed
00081 };
00082 
00083 #endif // MSG_H

Generated on Mon Jun 16 14:57:43 2008 for loon by  doxygen 1.3.9.1