[openssh-commits] [openssh] 01/04: upstream: add some variant log.h calls that prepend the calling

git+noreply at mindrot.org git+noreply at mindrot.org
Sun Oct 18 23:46:37 AEDT 2020


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 9cac1db52e6c4961c447910fe02cd68a3b2f9460
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Sun Oct 18 11:13:45 2020 +0000

    upstream: add some variant log.h calls that prepend the calling
    
    function name; ok markus@
    
    OpenBSD-Commit-ID: 4be1b2e2455b271ddb7457bc195c5367644f4e48
---
 log.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/log.h b/log.h
index 136bffc1..f9d7c5a9 100644
--- a/log.h
+++ b/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.26 2020/10/17 01:28:20 djm Exp $ */
+/* $OpenBSD: log.h,v 1.27 2020/10/18 11:13:45 djm Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
@@ -92,6 +92,18 @@ void	 sshfatal(const char *, const char *, int, int,
 #define ssh_logdie(...)		sshlogdie(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, __VA_ARGS__)
 #define ssh_sigdie(...)		sshsigdie(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, __VA_ARGS__)
 
+/* Variants that prepend the caller's function */
+#define ssh_nlog_f(level, ...)	sshlog(__FILE__, __func__, __LINE__, 1, level, __VA_ARGS__)
+#define ssh_debug3_f(...)	sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_DEBUG3, __VA_ARGS__)
+#define ssh_debug2_f(...)	sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_DEBUG2, __VA_ARGS__)
+#define ssh_debug_f(...)	sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_DEBUG1, __VA_ARGS__)
+#define ssh_verbose_f(...)	sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_VERBOSE, __VA_ARGS__)
+#define ssh_log_f(...)		sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_INFO, __VA_ARGS__)
+#define ssh_error_f(...)	sshlog(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, __VA_ARGS__)
+#define ssh_fatal_f(...)	sshfatal(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_FATAL, __VA_ARGS__)
+#define ssh_logdie_f(...)	sshlogdie(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, __VA_ARGS__)
+#define ssh_sigdie_f(...)	sshsigdie(__FILE__, __func__, __LINE__, 1, SYSLOG_LEVEL_ERROR, __VA_ARGS__)
+
 #define debug	ssh_debug
 #define debug1	ssh_debug1
 #define debug2	ssh_debug2

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list