Skip to content

Commit cbd6ef2

Browse files
committed
(micro)mamba and libmambapy uses spdlog based logging
1 parent f06aeb4 commit cbd6ef2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

libmamba/src/core/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace mamba
5454
void Context::start_logging(logging::AnyLogHandler log_handler)
5555
{
5656
// Only change the log-handler if specified, keep the current one otherwise.
57-
if (log_handler)
57+
if (log_handler)
5858
{
5959
logging::set_log_handler(std::move(log_handler), output_params);
6060
}

libmambapy/bindings/legacy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "mamba/core/util_os.hpp"
3434
#include "mamba/core/virtual_packages.hpp"
3535
#include "mamba/solver/problems_graph.hpp"
36+
#include "mamba/spdlog/logging_spdlog.hpp"
3637
#include "mamba/validation/tools.hpp"
3738
#include "mamba/validation/update_framework_v0_6.hpp"
3839

@@ -74,7 +75,7 @@ namespace mambapy
7475
public:
7576

7677
explicit Singletons(mamba::ContextOptions options)
77-
: m_context(std::move(options))
78+
: m_context(std::move(options), mamba::logging::spdlogimpl::LogHandler_spdlog{})
7879
{
7980
}
8081

micromamba/src/main.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "mamba/core/output.hpp"
2424
#include "mamba/core/thread_utils.hpp"
2525
#include "mamba/core/util_os.hpp"
26+
#include "mamba/spdlog/logging_spdlog.hpp"
2627
#include "mamba/version.hpp"
2728

2829
#include "umamba.hpp"
@@ -35,9 +36,10 @@ main(int argc, char** argv)
3536
{
3637
mamba::MainExecutor scoped_threads;
3738
mamba::Context ctx{ {
38-
.enable_logging = true,
39-
.enable_signal_handling = true,
40-
} };
39+
.enable_logging = true,
40+
.enable_signal_handling = true,
41+
},
42+
mamba::logging::spdlogimpl::LogHandler_spdlog{} };
4143
mamba::Console console{ ctx };
4244
mamba::Configuration config{ ctx };
4345

0 commit comments

Comments
 (0)