File tree 2 files changed +21
-0
lines changed
crates/stackable-operator
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
5
5
## [ Unreleased]
6
6
7
+ ### Added
8
+
9
+ - Add functionality to convert LogLevel to an OPA log level ([ #798 ] ).
10
+
11
+ [ #798 ] : https://github.com/stackabletech/operator-rs/pull/798
12
+
7
13
## [ 0.68.0] - 2024-05-22
8
14
9
15
- Support specifying externalTrafficPolicy in Services created by listener-operator ([ #773 ] , [ #789 ] , [ #791 ] ).
Original file line number Diff line number Diff line change @@ -377,6 +377,21 @@ impl LogLevel {
377
377
self . to_log4j_literal ( )
378
378
}
379
379
380
+ /// Convert the log level to a string understood by OPA
381
+ // based on https://www.openpolicyagent.org/docs/latest/cli/#options-10 opa has only log levels {debug,info,error}
382
+ pub fn to_opa_literal ( & self ) -> String {
383
+ match self {
384
+ LogLevel :: TRACE => "debug" ,
385
+ LogLevel :: DEBUG => "debug" ,
386
+ LogLevel :: INFO => "info" ,
387
+ LogLevel :: WARN => "error" ,
388
+ LogLevel :: ERROR => "error" ,
389
+ LogLevel :: FATAL => "error" ,
390
+ LogLevel :: NONE => "error" ,
391
+ }
392
+ . into ( )
393
+ }
394
+
380
395
/// Convert the log level to a Python expression
381
396
pub fn to_python_expression ( & self ) -> String {
382
397
match self {
You can’t perform that action at this time.
0 commit comments