|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
48 template<
typename T >
58 int main (
int argc,
char* argv[] )
64 log (
Notice() , std::string (
"std::string" ) );
66 log (
Notice() ,
"a" ,
'b' , std::string (
"c" ) ,
"d" ,
"e" ,
"f" ,
"g" ,
"h" ,
"i" ,
"j" ,
"k" ,
"l" ,
"m" ,
"n" ,
"o" ,
"p" ,
"q" ,
"r" ,
"s" ,
"t" ,
"u" ,
"v" ,
"w" ,
"x" ,
"y" ,
"z" ,
"0" ,
"1" ,
"2" ,
"3" ,
"4" ,
"5" );
68 gettimeofday ( &lTime, NULL );
70 log (
Notice() ,
Time ( lTime ,
TimeFmt< day,'/',mth,'/',year,' ',hr,':',min,':',sec,'.',usec >() ) ,
" truncated to the nearest usecond" );
71 log (
Notice() ,
Time ( lTime ,
TimeFmt< day,'/',mth,'/',year,' ',hr,':',min,':',sec >() ) ,
" truncated to the nearest second" );
72 log (
Notice() ,
Time ( lTime ,
TimeFmt< day,'/',mth,'/',year,' ',hr,':',min >() ) ,
" truncated to the nearest minute" );
83 log (
Notice() ,
"13 as a decimal uint16 : " ,
Integer ( uint16_t ( 13 ) ) );
84 log (
Notice() ,
"-13 as a decimal int16 : " ,
Integer ( int16_t ( -13 ) ) );
85 log (
Notice() ,
"13 as a decimal uint32 : " ,
Integer ( uint32_t ( 13 ) ) );
86 log (
Notice() ,
"-13 as a decimal int32 : " ,
Integer ( int32_t ( -13 ) ) );
87 log (
Notice() ,
"13 as a decimal uint64 : " ,
Integer ( uint64_t ( 13 ) ) );
88 log (
Notice() ,
"-13 as a decimal int64 : " ,
Integer ( int64_t ( -13 ) ) );
147 exception::FileNotFound lExc;
151 std::cout << lExc.what() << std::endl;
154 log (
Notice() , std::string (
"setLogLevelTo ( Error() ) : IF YOU >>DO<< SEE THIS, THEN THERE IS AN ERROR" ) );
155 log (
Error() , std::string (
"setLogLevelTo ( Error() ) : IF YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
157 log (
Notice() , std::string (
"setLogLevelTo ( Notice() ) : IF YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
158 log (
Error() , std::string (
"setLogLevelTo ( Notice() ) : IF YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
162 log (
Notice() , std::string (
"setLogLevelFromEnvironment ( \"UHAL_LOG_LEVEL\" ) : IF \"UHAL_LOG_LEVEL\" IS DEFINED ABOVE \"Notice()\" AND YOU >>DO<< SEE THIS, THEN THERE IS AN ERROR" ) );
163 log (
Error() , std::string (
"setLogLevelFromEnvironment ( \"UHAL_LOG_LEVEL\" ) : IF \"UHAL_LOG_LEVEL\" IS NOT DEFINED ABOVE \"Error()\" AND YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
165 log (
Notice() , std::string (
"disableLogging() : IF YOU >>DO<< SEE THIS, THEN THERE IS AN ERROR" ) );
166 log (
Error() , std::string (
"disableLogging() : IF YOU >>DO<< SEE THIS, THEN THERE IS AN ERROR" ) );
169 log (
Notice() , std::string (
"setLogLevelTo ( Notice() ) : IF YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
170 log (
Error() , std::string (
"setLogLevelTo ( Notice() ) : IF YOU DON'T SEE THIS, THEN THERE IS AN ERROR" ) );
172 catch (
const std::exception& aExc )
174 std::cerr <<
"ERROR: Caught Exception : " << aExc.what() << std::endl;
int main(int argc, char *argv[])
Empty struct which acts as a dummy variable for passing the formatting information around.
void setLogLevelTo(const FatalLevel &)
Function to specify, at runtime, that only messages with a severity level above Fatal should be logge...
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
A struct whose template parameters represent a time format.
_Integer< T, IntFmt<> > Integer(const T &aT)
Forward declare a function which creates an instance of the ultra-lightweight wrapper from an integer...
void disableLogging()
Function to disable all logging levels.
_Quote< T > Quote(const T &aT)
_Time< DefaultTimeFmt > Time(const timeval &aTime)
Helper function which wrap the template uglyness in a pretty package.
void setLogLevelFromEnvironment(const char *aEnvVar)
Function to specify that the logging level should be retrieved from an environment variable.