-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add native types for server LogDriver and LogLevel
This allows a better API usage by having native types around possible values. We also now rename the LogDriver for the container creation to `ContainerLogDriver` to be more distinct compared to the server log driver. Signed-off-by: Sascha Grunert <[email protected]>
- Loading branch information
1 parent
75562ef
commit 9c61646
Showing
4 changed files
with
57 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
package client | ||
|
||
const ( | ||
// LogDriverStdout is the log driver printing to stdio. | ||
LogDriverStdout = "stdout" | ||
|
||
// LogDriverSystemd is the log driver printing to systemd journald. | ||
LogDriverSystemd = "systemd" | ||
// LogLevel is the enum for all available server log levels. | ||
type LogLevel string | ||
|
||
const ( | ||
// LogLevelTrace is the log level printing only "trace" messages. | ||
LogLevelTrace = "trace" | ||
LogLevelTrace LogLevel = "trace" | ||
|
||
// LogLevelDebug is the log level printing only "debug" messages. | ||
LogLevelDebug = "debug" | ||
LogLevelDebug LogLevel = "debug" | ||
|
||
// LogLevelInfo is the log level printing only "info" messages. | ||
LogLevelInfo = "info" | ||
LogLevelInfo LogLevel = "info" | ||
|
||
// LogLevelWarn is the log level printing only "warn" messages. | ||
LogLevelWarn = "warn" | ||
LogLevelWarn LogLevel = "warn" | ||
|
||
// LogLevelError is the log level printing only "error" messages. | ||
LogLevelError = "error" | ||
LogLevelError LogLevel = "error" | ||
|
||
// LogLevelOff is the log level printing no messages. | ||
LogLevelOff = "off" | ||
LogLevelOff LogLevel = "off" | ||
) | ||
|
||
// LogDriver is the enum for all available server log drivers. | ||
type LogDriver string | ||
|
||
const ( | ||
// LogDriverStdout is the log driver printing to stdio. | ||
LogDriverStdout LogDriver = "stdout" | ||
|
||
// LogDriverSystemd is the log driver printing to systemd journald. | ||
LogDriverSystemd LogDriver = "systemd" | ||
) | ||
|
||
// CgroupManager is the enum for all available cgroup managers. | ||
type CgroupManager int | ||
|
||
const ( | ||
// CgroupManagerSystemd specifies to use systemd to create and manage | ||
// cgroups. | ||
CgroupManagerSystemd CgroupManager = iota | ||
|
||
// CgroupManagerCgroupfs specifies to use the cgroup filesystem to create | ||
// and manage cgroups. | ||
CgroupManagerCgroupfs | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters