VOL-1796 make the log level a chart parameter
Change-Id: Ia42e91ebe1028d0a3f1829dd07e5203784dec0e7
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
index 28e5f22..beed9fd 100644
--- a/voltha/templates/rw-core.yaml
+++ b/voltha/templates/rw-core.yaml
@@ -21,6 +21,23 @@
{{- $core_timeout := tpl $root.Values.rw_core.core_timeout . }}
{{- $long_request_timeout := tpl $root.Values.rw_core.timeout_long_request . }}
{{- $request_timeout := tpl $root.Values.rw_core.timeout_request . }}
+{{- $set_log_level := tpl .Values.rw_core.log_level . | upper }}
+{{- $log_level := 3 }}
+{{- if eq $set_log_level "DEBUG" }}
+{{- $log_level = 0 }}
+{{- else if eq $set_log_level "INFO" }}
+{{- $log_level = 1 }}
+{{- else if eq $set_log_level "WARN" }}
+{{- $log_level = 2 }}
+{{- else if eq $set_log_level "ERROR" }}
+{{- $log_level = 3 }}
+{{- else if eq $set_log_level "PANIC" }}
+{{- $log_level = 4 }}
+{{- else if eq $set_log_level "FATAL" }}
+{{- $log_level = 5 }}
+{{- else }}
+{{- $log_level = 3 }}
+{{- end }}
{{- range $i, $e := until $count }}
{{- $core_idx := add $i 1 }}
{{- $affinity_group := add1 (div $i 2) }}
@@ -99,7 +116,7 @@
- "-core_timeout={{ $core_timeout }}"
- "-timeout_long_request={{ $long_request_timeout }}"
- "-timeout_request={{ $request_timeout }}"
- - "-log_level=2"
+ - "-log_level={{ $log_level }}"
ports:
- containerPort: 50057
name: grpc-port