daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
280 stars 41 forks source link

Few issues solved - separator/DRY/list(...) #96

Closed Polkas closed 2 years ago

Polkas commented 2 years ago

I think it is enough for this PR, new ideas I will push in another one.

daroczig commented 2 years ago

sorry for the delay with this - got distracted by #98 and the weekend .. I will pick it up again in a few days

daroczig commented 2 years ago

This is great, thank you very much again! Also thanks for the ping in the other PR on the Travis -> GH actions update :+1:

I am ready to merge this, but may I ask the below changes before that?

No problem if not, I can totally do that, just let me know.

Polkas commented 2 years ago

I reverted ifelse, " quote and roxygen2 long lines split. Moreover I go through new code and update it to use 4 spaces.

Have a great new year:)

codecov-commenter commented 2 years ago

Codecov Report

Merging #96 (98f0f09) into master (ca896c7) will increase coverage by 1.65%. The diff coverage is 100.00%.

:exclamation: Current head 98f0f09 differs from pull request most recent head e9c6acf. Consider uploading reports for the commit e9c6acf to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   79.11%   80.76%   +1.65%     
==========================================
  Files          10       10              
  Lines         522      520       -2     
==========================================
+ Hits          413      420       +7     
+ Misses        109      100       -9     
Impacted Files Coverage Δ
R/helpers.R 100.00% <100.00%> (ø)
R/logger.R 98.85% <100.00%> (+7.70%) :arrow_up:
R/utils.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ca896c7...e9c6acf. Read the comment docs.

Polkas commented 2 years ago

Luckily I have a pythonanywhere account, with a Linux and the old R version (3.6.3).

Looks like we find some edge case.

should be "TEMP/nchar INFO: " and we get "TEMP/eval INFO: " (.topcall == eval(expr, pf) not nchar(logger:::catch_base_log(...)))

daroczig commented 2 years ago

I am pretty sure that is due to testtat messing with the scopes, see e.g. https://github.com/daroczig/logger/blob/master/tests/testthat/test-CRANSKIP-logger-namespaces.R#L18

One workaround, just like above, is making the call happen outside of testthat .. or just remove the fn from the check as well :zipper_mouth_face:

Polkas commented 2 years ago

Finally I removed one line (one test), as I think we should still test how.topcall influence the call length. If you prefer other solution, of course I am leaving it to you.)