Exposing log level in the helm-chart for single rw-core and openolt-adapter

Change-Id: I5027a1f2cee3246c695c5dab2c6823ab1294facd
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 2e4b6d0..d5fca77 100644
--- a/voltha/Chart.yaml
+++ b/voltha/Chart.yaml
@@ -17,7 +17,7 @@
 description: A Helm chart for Voltha based on K8S resources in Voltha project
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 2.1.16
+version: 2.1.17
 
 # appVersion is 2 because this chart contains multiple 2.x images that may have
 # different individual image versions.
diff --git a/voltha/templates/rw-core-only-one.yaml b/voltha/templates/rw-core-only-one.yaml
index 3dcb518..5c0949c 100644
--- a/voltha/templates/rw-core-only-one.yaml
+++ b/voltha/templates/rw-core-only-one.yaml
@@ -12,6 +12,23 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 {{- if .Values.therecanbeonlyone }}
+{{- $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 }}
 ---
 apiVersion: v1
 kind: Service
@@ -116,6 +133,7 @@
             - "-core_timeout=9999"
             - "-timeout_long_request=9999"
             - "-timeout_request=9999"
+            - "-log_level={{ $log_level }}"
             - "-probe_port=8080"
           ports:
             - containerPort: 50057
diff --git a/voltha/values.yaml b/voltha/values.yaml
index 86ef37e..8d288a7 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -22,7 +22,7 @@
 # The following are the default values used for every container in the
 # template.
 defaults:
-  log_level: "ERROR"
+  log_level: "WARN"
   image_registry: ''
   image_org: "voltha/"
   image_tag: ~