[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Logging in libssh

Hey Aris,

in libssh 0.6 I would like to get rid of enter_function() and leave_function() 
and introduce a new logging function. The logging function should be private. 
Here is the idea how to do it.

#ifndef __LINESTR__                                                                                                                                                   
#define __LINESTR__ SSH_STRINGIFY(__LINE__)                                                                                                                          
#ifndef __location__                                                                                                                                                  
#define __location__ __FILE__ ":" __LINESTR__                                                                                                                         

void _ssh_log(ssh_session session, int verbosity, const char *format, ...) 
#define SSH_LOG(session, verbosity, ...) \
	_ssh_log(session, verbosity, __location__, __VA_ARGS__)

void _ssh_log(ssh_session session, int verbosity, const char *location, const 
char *format, ...)
	/* my code here */

instead of __location__ we could log __FUNCTION__

I think timestamps would be also good. We already introduced hires timers.

	-- andreas

Andreas Schneider                   GPG-ID: F33E3FC6
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

About copy many files.Dairon Dominguez Vega <ddvega@xxxxxx>
Archive administrator: postmaster@lists.cynapses.org