-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Linux
Milestone
Description
Linux sys_syslog looks like this:
int syslog(int type, char *buf, int len);In Go's x/sys/unix, it's this
func Klogctl(typ int, buf []byte) (n int, err error)
// = syslog(typ, buf, len(buf))That's kinda lame, because the len arg is not only used for the length, as you can see in the man page:
SYSLOG_ACTION_CONSOLE_LEVEL (8)
The call sets console_loglevel to the value given in len,
which must be an integer between 1 and 8 (inclusive). The
kernel silently enforces a minimum value of
minimum_console_loglevel for len. See the log level section
for details. The bufp argument is ignored.
So now you, either you gotta construct the unix.Syscall yourself or trick Klogctl into passing the right length:
unix.Klogctl(8, []byte{1, 2}) // Set console level 2!
// Yah ok this is sillyPerhaps there should be another function like this?
func Klogset(typ int, arg int) error
// = syslog(typ, nullptr, arg)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Linux