• Kirill Smelkov's avatar
    software/ors-amarisoft: enb.jinja2.cfg: Unify logging · 04323c6d
    Kirill Smelkov authored
    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 nexedi/slapos!1522 .
    
    /cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
    /proposed-for-review-on nexedi/slapos!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: {
    ```
    04323c6d
enb.jinja2.cfg 26.8 KB