Skip to content

Commit

Permalink
chore: add new log keys to config schemas (#1313)
Browse files Browse the repository at this point in the history
* chore: add new log keys to config schemas

* Update config/flipt.schema.cue

Co-authored-by: George <me@georgemac.com>

* Update config/flipt.schema.cue

Co-authored-by: George <me@georgemac.com>

* chore: close cue schema

---------

Co-authored-by: George <me@georgemac.com>
  • Loading branch information
markphelps and GeorgeMac committed Feb 2, 2023
1 parent 18c4557 commit 0af41e9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
12 changes: 10 additions & 2 deletions 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)}]
#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)
}

#meta: {
Expand Down Expand Up @@ -129,5 +138,4 @@ package flipt
}

#ui: enabled?: bool | *true
...
}
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

0 comments on commit 0af41e9

Please sign in to comment.