]> andersk Git - openssh.git/blobdiff - log-client.c
- (djm) Fix AIX limits from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
[openssh.git] / log-client.c
index 18700cdb1025c6ef5eac1c305af33f74814a5163..7e9fd61e78cc676a66d44ca860a75e612f6d85eb 100644 (file)
@@ -1,21 +1,21 @@
 /*
-
-log-client.c
-
-Author: Tatu Ylonen <ylo@cs.hut.fi>
-
-Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
-                   All rights reserved
-
-Created: Mon Mar 20 21:13:40 1995 ylo
-
-Client-side versions of debug(), log(), etc.  These print to stderr.
-This is a stripped down version of log-server.c.
-
-*/
+ *
+ * log-client.c
+ *
+ * Author: Tatu Ylonen <ylo@cs.hut.fi>
+ *
+ * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
*                    All rights reserved
+ *
+ * Created: Mon Mar 20 21:13:40 1995 ylo
+ *
+ * Client-side versions of debug(), log(), etc.  These print to stderr.
+ * This is a stripped down version of log-server.c.
+ *
+ */
 
 #include "includes.h"
-RCSID("$Id$");
+RCSID("$OpenBSD: log-client.c,v 1.9 2000/06/20 01:39:42 markus Exp $");
 
 #include "xmalloc.h"
 #include "ssh.h"
@@ -23,41 +23,40 @@ RCSID("$Id$");
 static LogLevel log_level = SYSLOG_LEVEL_INFO;
 
 /* Initialize the log.
    av0       program name (should be argv[0])
    level     logging level
    */
*   av0       program name (should be argv[0])
*   level     logging level
+ */
 
 void
 log_init(char *av0, LogLevel level, SyslogFacility ignored1, int ignored2)
 {
-  switch (level)
-    {
-    case SYSLOG_LEVEL_QUIET:
-    case SYSLOG_LEVEL_ERROR:
-    case SYSLOG_LEVEL_FATAL:
-    case SYSLOG_LEVEL_INFO:
-    case SYSLOG_LEVEL_CHAT:
-    case SYSLOG_LEVEL_DEBUG:
-      log_level = level;
-      break;
-    default:
-      /* unchanged */
-      break;
-    }
+       switch (level) {
+       case SYSLOG_LEVEL_QUIET:
+       case SYSLOG_LEVEL_ERROR:
+       case SYSLOG_LEVEL_FATAL:
+       case SYSLOG_LEVEL_INFO:
+       case SYSLOG_LEVEL_VERBOSE:
+       case SYSLOG_LEVEL_DEBUG:
+               log_level = level;
+               break;
+       default:
+               /* unchanged */
+               break;
+       }
 }
 
-#define MSGBUFSIZE 1024
+#define MSGBUFSIZ 1024
 
 void
 do_log(LogLevel level, const char *fmt, va_list args)
 {
-  char msgbuf[MSGBUFSIZE];
-
-  if (level > log_level)
-    return;
-  if (level == SYSLOG_LEVEL_DEBUG)
-    fprintf(stderr, "debug: ");
-  vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
-  fprintf(stderr, "%s", msgbuf);
-  fprintf(stderr, "\r\n");
+       char msgbuf[MSGBUFSIZ];
+
+       if (level > log_level)
+               return;
+       if (level == SYSLOG_LEVEL_DEBUG)
+               fprintf(stderr, "debug: ");
+       vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
+       fprintf(stderr, "%s", msgbuf);
+       fprintf(stderr, "\r\n");
 }
This page took 0.036058 seconds and 4 git commands to generate.