Symbolic names and number in the appropriate range are allowed
(log_level_from_string() DTRT already).
The target names are more messy, so we leave the verification to the service.
#include "stat-util.h"
#include "string-table.h"
#include "strv.h"
+#include "syslog-util.h"
#include "sysv-compat.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
int r;
if (value) {
+ if (level) {
+ if (log_level_from_string(value) < 0)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "\"%s\" is not a valid log level.", value);
+ }
+
r = bus_set_property(bus, bloc,
level ? "LogLevel" : "LogTarget",
&error, "s", value);