Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add new log keys to config schemas #1313

Merged
merged 4 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion config/flipt.schema.cue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package flipt

import "strings"

#FliptSpec: {
// flipt-schema-v1
//
Expand Down Expand Up @@ -94,13 +96,20 @@ package flipt
conn_max_lifetime?: int
}

#lower: ["debug", "error", "fatal", "info", "panic", "trace", "warn"]
#all: #lower + [ for x in #lower {strings.ToUpper(x)}]
markphelps marked this conversation as resolved.
Show resolved Hide resolved
#log: {
file?: string
encoding?: "json" | "console" | *"console"
level?: #log.#log_level
grpc_level?: #log.#log_level
keys?: {
time?: string | *"T"
level?: string | *"L"
message?: string | *"M"
}

#log_level: "debug" | "DEBUG" | "error" | "ERROR" | "fatal" | "FATAL" | "info" | "INFO" | "PANIC" | "panic" | "trace" | "TRACE" | "warn" | "WARN"
#log_level: or(#all)
markphelps marked this conversation as resolved.
Show resolved Hide resolved
}

#meta: {
Expand Down
23 changes: 23 additions & 0 deletions config/flipt.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@
"grpc_level": {
"$ref": "#/definitions/log/$defs/log_level",
"type": "string"
},
"keys": {
"$ref": "#/definitions/log/$defs/log_keys",
"type": "object"
}
},
"required": [],
Expand All @@ -332,6 +336,25 @@
"warn",
"WARN"
]
},
"log_keys": {
"type": "object",
"additionalProperties": false,
"properties": {
"level": {
"type": "string",
"default": "L"
},
"time": {
"type": "string",
"default": "T"
},
"message": {
"type": "string",
"default": "M"
}
},
"required": []
}
}
},
Expand Down