Commit 04323c6d authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb.jinja2.cfg: Unify logging

1. Currently we have separate log_options for LTE and NR cases with listing
different subsystems in each. But in MultiRU one enb will be driving both LTE
and NR cells at the same time, so we will need to define both LTE- and
NR-related levels.

-> Merge all log settings into one log_options as a preparatory step

For current state it does not hurt for an LTE if we set e.g. ngap.level, and it
does not hurt for NR if we set e.g. s1ap.level - since those layers will be
unused. This way merging log settings for both LTE and NR subsystems is ok.

--------

2. Factorize log_phy_debug handling: instead of duplicating whole
log_options line and changing only phy.level settings there, construct the
log_options line programmatically and handle phy.level on its own.

--------

3. Use log/enb.log log_filename for both LTE and NR cases. In the upcoming
MultiRU there might be several cells activated at the same time and in general
it will be not possible to say are we doing "enb" or "gnb" now - for example if
there will be two cells - one LTE and one NR.

-> Use enb.log for log filename uniformly similarly to how the software is
named (lteenb) even though it can work as both enb and gnb.

For the reference we do the same with enb.xlog in !1522 .

/cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
/proposed-for-review-on !1527
/reviewed-by TrustMe

Appendix. Diff for rendered enb.cfg and gnb.cfg before and after this patch

```
$ git diff --no-index config/{old,out}
```

```diff
diff --git a/config/old/enb.cfg b/config/out/enb.cfg
index 467bb6364..1843e0f24 100644
--- a/config/old/enb.cfg
+++ b/config/out/enb.cfg
@@ -3,9 +3,7 @@

 {
-
-  log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
-
+  log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
   log_filename: "log/enb.log",

diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
index 18523818a..d76b45d3c 100644
--- a/config/old/gnb.cfg
+++ b/config/out/gnb.cfg
@@ -3,10 +3,8 @@

 {
-
-  log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
-
-  log_filename: "log/gnb.log",
+  log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
+  log_filename: "log/enb.log",

   rf_driver: {
```
parent d8b0a558
...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149 ...@@ -108,7 +108,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg] [enb.jinja2.cfg]
filename = config/enb.jinja2.cfg filename = config/enb.jinja2.cfg
md5sum = 95251487e8750756dbd170f28a024ea1 md5sum = 25028d84a3dcea300eb40789c5da8e2b
[drb_lte.jinja2.cfg] [drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg filename = config/drb_lte.jinja2.cfg
......
...@@ -62,23 +62,14 @@ ...@@ -62,23 +62,14 @@
{% endif %} {% endif %}
{ {
{%- if do_lte %} log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,
{% if slapparameter_dict.get('log_phy_debug', False) %} {%- if slapparameter_dict.get('log_phy_debug', False) -%}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=debug,file.rotate=1G,file.path=/dev/null", phy.level=debug
{% else %} {%- else -%}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null", phy.level=info
{% endif %} {%- endif -%}
,file.rotate=1G,file.path=/dev/null",
log_filename: "{{ directory['log'] }}/enb.log", log_filename: "{{ directory['log'] }}/enb.log",
{%- endif %}
{%- if do_nr %}
{% if slapparameter_dict.get('log_phy_debug', False) %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=debug,file.rotate=1G,file.path=/dev/null",
{% else %}
log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
{% endif %}
log_filename: "{{ directory['log'] }}/gnb.log",
{%- endif %}
{% if ru.ru_type == "lopcomm" %} {% if ru.ru_type == "lopcomm" %}
rf_driver: { rf_driver: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment