Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d9ac264
Don't log if `--json` or `--quiet`
Klaim Mar 19, 2026
243d928
fixed LogHandler_History incorrect filtering of log records + added r…
Klaim Mar 25, 2026
bb89645
improved logging tests
Klaim Mar 25, 2026
58dc097
json output will contain log records passing the log level filter (>=…
Klaim Mar 25, 2026
9ca3a20
attempt to get some info from tests
Klaim Mar 26, 2026
22a1177
fixed test expecting an error in cerr, looking into json instead
Klaim Mar 27, 2026
fe59cb8
LogHandler_History allows capture with clear
Klaim Mar 30, 2026
5515fb1
output a potentially empty json if `--json` is used even if no log hi…
Klaim Mar 30, 2026
f529c23
console must capture and output json after error logging
Klaim Mar 30, 2026
dee6f12
(micro)mamba always reset the console whatever the way it returns
Klaim Mar 30, 2026
4f3db35
tests: read json from process error (attempt)
Klaim Mar 30, 2026
e62c40e
do not output Console's JSON when command already outputs JSON or YAML
Klaim Mar 30, 2026
5596d03
`--json` and `--quiet` are specially handled before creating the cont…
Klaim Mar 30, 2026
91c65a8
keep "run --help" message when arguments parsing failed
Klaim Mar 30, 2026
2f7c9ae
workaround compilers incorrectly requiring explicit member initializa…
Klaim Mar 30, 2026
808be20
config sub-commands outputing json are merged with the normal json ou…
Klaim Mar 31, 2026
1e752c7
removed incorrect code and comment
Klaim Mar 31, 2026
ce45264
let cli11 handle it's ownt errors but output where we want it to depe…
Klaim Mar 31, 2026
ee538ba
fix test json output erorr checks
Klaim Apr 7, 2026
63ed7bd
fixup
Klaim Apr 8, 2026
3fc7d69
partial text fix
Klaim Apr 8, 2026
cfeadc9
list sub-command's array of packages is now part of the returned json…
Klaim Apr 13, 2026
b6736ee
fixed: tools log-handlers not properly filtering log records
Klaim Apr 14, 2026
fafe861
adapt integration tests `list` calls assuming the result is a package…
Klaim Apr 15, 2026
b3b5110
fixed: `mamba create --dry-run --json` output 2 json objects
Klaim Apr 17, 2026
139beec
fixed: `list` subcommand tests guaranteed to return an array even if …
Klaim Apr 17, 2026
7eeed5a
fixed: `mamba env list --json` outputs 2 json objects
Klaim Apr 17, 2026
30de13b
fixed: `mamba env export|list --json` outputing 2 json objects
Klaim Apr 17, 2026
b7f20cf
fix: mark `LogHandler_History::is_started` inline in header
jjerphan May 11, 2026
42aef3d
Make linters happy
jjerphan May 11, 2026
5e72263
merge origin/main + adaptations
Klaim Jun 3, 2026
a8753d3
log handlers are now comparable to check if they refer to the same in…
Klaim Jun 8, 2026
0fce75f
fixed: logging backtrace changes were not persisted in logging parame…
Klaim Jun 8, 2026
1394350
tweak/simplification
Klaim Jun 8, 2026
a5620e8
Merge remote-tracking branch 'origin/main' into no-logging-json-quiet
Klaim Jun 8, 2026
b8b7c12
fixed: incorrect JSON pointer formation from object members names
Klaim Jun 8, 2026
b962248
mamba tests: expect the "log_history" field in json output
Klaim Jun 8, 2026
4a78575
repoquery subcommand json output now goes through the general output …
Klaim Jun 8, 2026
38c3bc9
support version output in json
Klaim Jun 8, 2026
7c7d66a
updated comment in tests
Klaim Jun 8, 2026
17e9a06
fixed: hide_secrets regex matching with empty names
Klaim Jun 8, 2026
a98b70e
Merge remote-tracking branch 'origin/main' into no-logging-json-quiet
Klaim Jun 8, 2026
e495113
increased probably too big timeout
Klaim Jun 9, 2026
007e13a
formatting
Klaim Jun 9, 2026
9d8b7bd
formatting
Klaim Jun 9, 2026
240d53d
removed unclear comment
Klaim Jun 9, 2026
daeb4ee
improved log record filtering clarity (addressing reviews)
Klaim Jun 10, 2026
3e21106
Merge branch 'main' into no-logging-json-quiet
Klaim Jun 11, 2026
da56561
fix typo
Klaim Jun 11, 2026
2146be8
fix typo
Klaim Jun 11, 2026
3b3ebae
Revert "increased probably too big timeout"
Klaim Jun 11, 2026
ace8813
rewrote basic_backtrace::push_if_enabled to take an invocable used if…
Klaim Jun 16, 2026
395cbcb
(micro)mamba: rewrote options intiialization for clarity
Klaim Jun 16, 2026
05c46ac
removed comments that is not up to date
Klaim Jun 16, 2026
ba8cfd5
appease warnings that assumes developers ignores of the concept of "s…
Klaim Jun 16, 2026
fa0f430
formatting
Klaim Jun 16, 2026
fd5a8e8
Merge remote-tracking branch 'origin/main' into no-logging-json-quiet
Klaim Jun 16, 2026
855eb58
Merge branch 'main' into no-logging-json-quiet
Klaim Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions libmamba/include/mamba/core/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@ namespace mamba
class Logger;
class Context;

struct OutputParams : LoggingParams
{
bool json{ false };
bool quiet{ false };
int verbosity{ 0 };
};

struct ContextOptions
{
bool enable_logging = false;
bool enable_signal_handling = false;
std::optional<OutputParams> output_params = {};
};

// Context singleton class
Expand All @@ -78,12 +86,7 @@ namespace mamba

static void use_default_signal_handler(bool val);

struct OutputParams : LoggingParams
{
bool json{ false };
bool quiet{ false };
int verbosity{ 0 };
};
using OutputParams = mamba::OutputParams;

struct GraphicsParams
{
Expand Down
23 changes: 19 additions & 4 deletions libmamba/include/mamba/core/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,13 @@ namespace mamba
auto unsafe_get() const -> const std::remove_pointer_t<P>*;
///@}

/** `true` if the log handler instance is the same for both.
*/
///@{
friend bool operator==(const AnyLogHandler&, const AnyLogHandler&) = default;
friend bool operator!=(const AnyLogHandler&, const AnyLogHandler&) = default;
///@}

private:

struct Interface;
Expand Down Expand Up @@ -792,16 +799,21 @@ namespace mamba

/** Changes the logging system configuration.

If a log handler is registered, this function calls `AnyLogHandler::set_params` with the
same arguments.
If a log handler is registered and `update_log_handler` is `true`,
this function calls `AnyLogHandler::set_params` with the same arguments.
@see `mamba::logging:LogHandler` and @see `mamba::logging::AnyLogHandler` for details.

This call is thread safe as long as the log handler implementation fulfills the
thread-safety requirements, @see `mamba::logging::LogHandler`.

Warning: `update_log_handler = false` should only be used when implementing
other operations that need to update the params and then update the log handler
themselves, separately.

@returns The previous configuration of the logging system.
*/
auto set_logging_params(LoggingParams new_params) -> LoggingParams;
auto set_logging_params(LoggingParams new_params, bool update_log_handler = true)
-> LoggingParams;

// TODO: potential performance improvement: log(record_generator, log_level) where
// record_generator is a callable which generates the log record but is only called AFTER we
Expand Down Expand Up @@ -882,7 +894,7 @@ namespace mamba
auto log_backtrace() -> void;

/** Sends the log records in the backtrace history to the implementation's logging sinks,
but without filtering the logging level of the log records.
but with filtering the logging level of the log records as if they were logged now.

If a log handler is registered, this function calls
`AnyLogHandler::log_backtrace_no_guards`, otherwise this function will do nothing.
Expand Down Expand Up @@ -1024,6 +1036,9 @@ namespace mamba::logging

inline auto enable_backtrace(size_t records_buffer_size) -> void
{
auto params = get_logging_params();
params.log_backtrace = records_buffer_size;
set_logging_params(params, false);
call_log_handler_if_existing(&AnyLogHandler::enable_backtrace, records_buffer_size);
}

Expand Down
Loading
Loading