Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Tests to use the new logger #585

Merged

Conversation

arcavaliere
Copy link
Contributor

@arcavaliere arcavaliere commented Dec 21, 2019

Resolves #578
Updates runtests to use the ModelLogger
Updates tests to use @info instead of println

Updates runtests to use the ModelLogger
@codecov
Copy link

codecov bot commented Dec 21, 2019

Codecov Report

Merging #585 into master will increase coverage by 0.97%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #585      +/-   ##
==========================================
+ Coverage   72.17%   73.14%   +0.97%     
==========================================
  Files          70       70              
  Lines        2016     2011       -5     
==========================================
+ Hits         1455     1471      +16     
+ Misses        561      540      -21
Impacted Files Coverage Δ
src/boundary_conditions.jl 61.05% <0%> (ø) ⬆️
src/logger.jl 76.19% <0%> (+76.19%) ⬆️

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 5888900...01ec7b4. Read the comment docs.

Copy link
Member

@ali-ramadhan ali-ramadhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks @arcavaliere! You somehow even increased test coverage lol.

I think you over-indented most of test_abstract_operations.jl so would be good to fix that but otherwise looks good to merge.

Looking at the logs do you think it'll be more readable if we move the timestamp to the very beginning of the line? I guess since it's using 24-hour timestamps then it'll always be the same character width. Doesn't have to be part of this PR.

Also if you replace "#578" with "Resolves #578" in your original comment then merging this PR will also automatically close #578. A nice GitHub feature.

include("test_examples.jl")
include("test_abstract_operations.jl")
include("test_verification.jl")
with_logger(ModelLogger()) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty clean! I guess it makes sense to use with_logger here but for log messages peppered around the rest of the package would global_logger(ModelLogger()) be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so! Do you think the line could be added in Oceananigans.jl?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should do that, hopefully it doesn't also effect other packages. But we can leave it for another PR to avoid dragging this one out.

@arcavaliere
Copy link
Contributor Author

Looking at the logs do you think it'll be more readable if we move the timestamp to the very beginning of the line? I guess since it's using 24-hour timestamps then it'll always be the same character width. Doesn't have to be part of this PR.

I think the timestamp coming first would be good. I also think having the LogLevel string be uppercase would also help readability.

@ali-ramadhan
Copy link
Member

I think the timestamp coming first would be good. I also think having the LogLevel string be uppercase would also help readability.

True, that would be nice! I'll merge this PR to avoid dragging it out but we should discuss how to improve the logger in an issue or future PR!

@ali-ramadhan ali-ramadhan changed the title [WIP] #578 Switch Tests to use the new logger Switch Tests to use the new logger Dec 21, 2019
@ali-ramadhan ali-ramadhan merged commit 2d8eaa5 into CliMA:master Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch tests to use the new logger
2 participants