Skip to content

Commit 0f39e1f

Browse files
committed
vlogger: use the same defaults as logger(1)
1 parent 0566391 commit 0f39e1f

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

vlogger.8

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ See
6666
or
6767
.Xr syslog 3 .
6868
The default is
69-
.Pa daemon.info .
69+
.Dq user.notice .
7070
.It Fl S
7171
Force
7272
.Nm
@@ -87,6 +87,9 @@ Defines the
8787
.Pa ident
8888
which is used as prefix for each log message or passed as first argument to
8989
.Pa /etc/vlogger .
90+
The default is the
91+
.Ev LOGNAME
92+
environment variable.
9093
.It Ar message
9194
Write the
9295
.Ar message

vlogger.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ main(int argc, char *argv[])
7878
{
7979
char buf[1024];
8080
char *p, *argv0;
81-
char *tag = "vlogger";
81+
char *tag = NULL;
8282
int c;
8383
int Sflag = 0;
8484
int logflags = 0;
85-
int facility = LOG_DAEMON;
86-
int level = LOG_INFO;
85+
int facility = LOG_USER;
86+
int level = LOG_NOTICE;
8787

8888
argv0 = *argv;
8989

@@ -135,7 +135,7 @@ main(int argc, char *argv[])
135135
exit(1);
136136
}
137137

138-
openlog(tag, logflags, facility);
138+
openlog(tag ? tag : getlogin(), logflags, facility);
139139

140140
if (argc > 0) {
141141
size_t len;

0 commit comments

Comments
 (0)