
15 Feb
2005
15 Feb
'05
11:42 p.m.
int main(int argc, char* argv) { my_log alog; basic_log_manager<my_log > alm(alog); alm.log(my_e_data(__FILE__, __LINE__, "Bad Operation")); return 0; }
That is less scary than the earlier example. There is no way I'm going to type that out every time but I can do: #define LOG(x) alm.log(my_e_data(__FILE__, __LINE__, (x))) Hhmm, no, I've lost the ability to write: LOG("a="<<a<<",b="<<b); So I guess I define my macro based on your earlier example: #define LOG(x) alm.log(basic_entry<>("") \ << boost::posix_time::microsec_clock::local_time() \ << "," << __FILE__ \ << "," << __LINE__ \ << "," << BOOST_CURRENT_FUNCTION \ << ":" << (x)) Darren