Skip to content

Commit

Permalink
Making Logger struct mutable and adding tests for `_logging_channel…
Browse files Browse the repository at this point in the history
…` related functions
  • Loading branch information
pebeto committed May 21, 2024
1 parent 4e492d1 commit 4842b97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name and the artifact location specified previously. Also it contains a
more information, see [MLFlowClient.jl](https://juliaai.github.io/MLFlowClient.jl/dev/reference/#MLFlowClient.MLFlow).
"""
struct Logger
mutable struct Logger
service::MLFlow
verbosity::Int
experiment_name::String
Expand Down Expand Up @@ -56,7 +56,7 @@ operations from the `_logging_channel`. This function closes the channel
to stop the background loop.
"""
function close(logger::Logger)
close(logger._logging_channel)
Base.close(logger._logging_channel)
end

"""
Expand Down
5 changes: 5 additions & 0 deletions test/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@
" artifact_location=\"$(logger.artifact_location)\",\n" *
") using MLFlow API version $(logger.service.apiversion)"
@test String(take!(io)) == test_string

MLJFlow.close(logger)
@test ~(Base.isopen(logger._logging_channel))
logger._logging_channel = MLJFlow.open_logging_channel()
@test Base.isopen(logger._logging_channel)
end

0 comments on commit 4842b97

Please sign in to comment.