Skip to content

Commit 321e2e8

Browse files
authored
new: added config schema (#277)
1 parent 97bc2dc commit 321e2e8

File tree

4 files changed

+295
-0
lines changed

4 files changed

+295
-0
lines changed

etc/defaults/config-ecs.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json
2+
13
# Settings for fields processing.
24
fields:
35
# Configuration of the predefined set of fields.

etc/defaults/config-k8s.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json
2+
13
# Settings for fields processing.
24
fields:
35
# Configuration of the predefined set of fields.

etc/defaults/config.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/pamburus/hl/master/schema/json/config.json
2+
13
# Time format, see https://man7.org/linux/man-pages/man1/date.1.html for details.
24
time-format: '%b %d %T.%3N'
35

schema/json/config.json

+289
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"properties": {
6+
"time-format": {
7+
"type": "string"
8+
},
9+
"time-zone": {
10+
"type": "string"
11+
},
12+
"fields": {
13+
"type": "object",
14+
"additionalProperties": false,
15+
"properties": {
16+
"predefined": {
17+
"type": "object",
18+
"additionalProperties": false,
19+
"properties": {
20+
"time": {
21+
"type": "object",
22+
"additionalProperties": false,
23+
"properties": {
24+
"show": {
25+
"type": "string"
26+
},
27+
"names": {
28+
"type": "array",
29+
"items": {
30+
"type": "string"
31+
}
32+
}
33+
},
34+
"required": [
35+
"names"
36+
]
37+
},
38+
"logger": {
39+
"type": "object",
40+
"additionalProperties": false,
41+
"properties": {
42+
"names": {
43+
"type": "array",
44+
"items": {
45+
"type": "string"
46+
}
47+
}
48+
},
49+
"required": [
50+
"names"
51+
]
52+
},
53+
"level": {
54+
"type": "object",
55+
"additionalProperties": false,
56+
"properties": {
57+
"show": {
58+
"type": "string"
59+
},
60+
"variants": {
61+
"type": "array",
62+
"items": {
63+
"type": "object",
64+
"additionalProperties": false,
65+
"properties": {
66+
"names": {
67+
"type": "array",
68+
"items": {
69+
"type": "string"
70+
}
71+
},
72+
"values": {
73+
"type": "object",
74+
"additionalProperties": false,
75+
"properties": {
76+
"debug": {
77+
"type": "array",
78+
"items": {
79+
"type": [
80+
"string",
81+
"integer"
82+
]
83+
}
84+
},
85+
"info": {
86+
"type": "array",
87+
"items": {
88+
"type": [
89+
"string",
90+
"integer"
91+
]
92+
}
93+
},
94+
"warning": {
95+
"type": "array",
96+
"items": {
97+
"type": [
98+
"string",
99+
"integer"
100+
]
101+
}
102+
},
103+
"error": {
104+
"type": "array",
105+
"items": {
106+
"type": [
107+
"string",
108+
"integer"
109+
]
110+
}
111+
}
112+
}
113+
},
114+
"level": {
115+
"type": "string",
116+
"enum": [
117+
"debug",
118+
"info",
119+
"warning",
120+
"error"
121+
]
122+
}
123+
},
124+
"required": [
125+
"names"
126+
]
127+
}
128+
}
129+
},
130+
"required": [
131+
"variants"
132+
]
133+
},
134+
"message": {
135+
"type": "object",
136+
"additionalProperties": false,
137+
"properties": {
138+
"names": {
139+
"type": "array",
140+
"items": {
141+
"type": "string"
142+
}
143+
}
144+
},
145+
"required": [
146+
"names"
147+
]
148+
},
149+
"caller": {
150+
"type": "object",
151+
"additionalProperties": false,
152+
"properties": {
153+
"names": {
154+
"type": "array",
155+
"items": {
156+
"type": "string"
157+
}
158+
}
159+
},
160+
"required": [
161+
"names"
162+
]
163+
},
164+
"caller-file": {
165+
"type": "object",
166+
"additionalProperties": false,
167+
"properties": {
168+
"names": {
169+
"type": "array",
170+
"items": {
171+
"type": "string"
172+
}
173+
}
174+
},
175+
"required": [
176+
"names"
177+
]
178+
},
179+
"caller-line": {
180+
"type": "object",
181+
"additionalProperties": false,
182+
"properties": {
183+
"names": {
184+
"type": "array",
185+
"items": {
186+
"type": "string"
187+
}
188+
}
189+
},
190+
"required": [
191+
"names"
192+
]
193+
}
194+
}
195+
},
196+
"ignore": {
197+
"type": "array",
198+
"items": [
199+
{
200+
"type": "string"
201+
}
202+
]
203+
},
204+
"hide": {
205+
"type": "array",
206+
"items": {
207+
"type": "string"
208+
}
209+
}
210+
}
211+
},
212+
"formatting": {
213+
"type": "object",
214+
"additionalProperties": false,
215+
"properties": {
216+
"flatten": {
217+
"type": "string",
218+
"enum": [
219+
"never",
220+
"always"
221+
]
222+
},
223+
"punctuation": {
224+
"type": "object",
225+
"additionalProperties": false,
226+
"properties": {
227+
"logger-name-separator": {
228+
"type": "string"
229+
},
230+
"field-key-value-separator": {
231+
"type": "string"
232+
},
233+
"string-opening-quote": {
234+
"type": "string"
235+
},
236+
"string-closing-quote": {
237+
"type": "string"
238+
},
239+
"source-location-separator": {
240+
"type": "string"
241+
},
242+
"hidden-fields-indicator": {
243+
"type": "string"
244+
},
245+
"level-left-separator": {
246+
"type": "string"
247+
},
248+
"level-right-separator": {
249+
"type": "string"
250+
},
251+
"input-number-prefix": {
252+
"type": "string"
253+
},
254+
"input-number-left-separator": {
255+
"type": "string"
256+
},
257+
"input-number-right-separator": {
258+
"type": "string"
259+
},
260+
"input-name-left-separator": {
261+
"type": "string"
262+
},
263+
"input-name-right-separator": {
264+
"type": "string"
265+
},
266+
"input-name-clipping": {
267+
"type": "string"
268+
},
269+
"input-name-common-part": {
270+
"type": "string"
271+
},
272+
"array-separator": {
273+
"type": "string"
274+
}
275+
}
276+
}
277+
}
278+
},
279+
"concurrency": {
280+
"type": [
281+
"integer",
282+
"null"
283+
]
284+
},
285+
"theme": {
286+
"type": "string"
287+
}
288+
}
289+
}

0 commit comments

Comments
 (0)