diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-09-10 11:49:53 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-09-10 12:38:42 +0200 |
commit | c8f48a247808fe9ad8a59774545f527dbea71cfc (patch) | |
tree | d53ffa85dda96b08bd9c091057046cbefe98d284 /include | |
parent | 08129002de26ff010d55e4ad4bc93c675a3412be (diff) | |
download | libssh-c8f48a247808fe9ad8a59774545f527dbea71cfc.tar.gz libssh-c8f48a247808fe9ad8a59774545f527dbea71cfc.tar.xz libssh-c8f48a247808fe9ad8a59774545f527dbea71cfc.zip |
log: Improve the logging function.
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/libssh.h | 7 | ||||
-rw-r--r-- | include/libssh/priv.h | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 0a78084..2a8c70f 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -407,7 +407,12 @@ LIBSSH_API int ssh_init(void); LIBSSH_API int ssh_is_blocking(ssh_session session); LIBSSH_API int ssh_is_connected(ssh_session session); LIBSSH_API int ssh_is_server_known(ssh_session session); -LIBSSH_API void ssh_log(ssh_session session, int prioriry, const char *format, ...) PRINTF_ATTRIBUTE(3, 4); + +/* legacy */ +LIBSSH_API void ssh_log(ssh_session session, + int prioriry, + const char *format, ...) PRINTF_ATTRIBUTE(3, 4); + LIBSSH_API ssh_channel ssh_message_channel_request_open_reply_accept(ssh_message msg); LIBSSH_API int ssh_message_channel_request_reply_success(ssh_message msg); LIBSSH_API void ssh_message_free(ssh_message msg); diff --git a/include/libssh/priv.h b/include/libssh/priv.h index d7ba68d..7493d14 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -263,6 +263,14 @@ int ssh_options_apply(ssh_session session); /* server.c */ SSH_PACKET_CALLBACK(ssh_packet_kexdh_init); +/* LOGGING */ +#define SSH_LOG(session, priority, ...) \ + _ssh_log(session, priority, __FUNCTION__, __VA_ARGS__) +void ssh_log_function(ssh_session session, + int prioriry, + const char *function, + const char *format, ...) PRINTF_ATTRIBUTE(4, 5); + /** Free memory space */ #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) |