Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Log in C++?

Tags:

c++

logging

I want to print lots of debug log prints in C++. Is there a built-in library that will allow me to turn on/off these prints without commenting them out as I do today (i.e., let the user use a -print_log/-debug flag)?

EDIT: third party loggers will be welcomed.

Please include a short example of how to do this.

like image 284
Amir Rachum Avatar asked Jan 01 '11 22:01

Amir Rachum


People also ask

Is there a log function in C?

C log() PrototypeThe log() function takes a single argument and returns a value of type float . It is defined in <math. h> header file. In order to find the log() of long double or float numbers, you can use the following prototype.


1 Answers

google glog is a good example

http://google-glog.googlecode.com/svn/trunk/doc/glog.html

like image 90
Industrial-antidepressant Avatar answered Oct 05 '22 12:10

Industrial-antidepressant