-
Notifications
You must be signed in to change notification settings - Fork 226
refactor(logger): give each component library its own logger #1778
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cdb994e
refactor(logger): give each component library its own logger
ramakrishnap-nv 9e59d0d
fix(logger): address review on guard order and macro propagation
ramakrishnap-nv 651b79e
Merge remote-tracking branch 'origin/main' into refactor/per-library-…
ramakrishnap-nv 3a56336
Merge remote-tracking branch 'origin/main' into refactor/per-library-…
ramakrishnap-nv 0d575bc
fix(logger): correct static destruction order and rewrite the tests
ramakrishnap-nv ad82df1
fix(logger): keep the depth counter balanced when configure throws
ramakrishnap-nv 72cdfc3
refactor(logger): make log_buffer's state private
ramakrishnap-nv ba3ca2f
Merge remote-tracking branch 'origin/main' into refactor/per-library-…
ramakrishnap-nv 3f042f8
fix(logger): restore a sink when init_logger_t fails to configure
ramakrishnap-nv 1914d37
refactor(logger): one lifetime mechanism, and make the visibility gua…
ramakrishnap-nv e031c6b
fix(logger): do not let a stale guard reset a newer configuration
ramakrishnap-nv fdf6581
test(logger): use a trigger that fails to open for root too
ramakrishnap-nv ec24e04
Merge branch 'main' into refactor/per-library-logger
ramakrishnap-nv 78583ec
refactor(logger): trim over-explanatory comments
ramakrishnap-nv 2fe7bbf
test(logger): cover mathopt/routing configured to different files tog…
ramakrishnap-nv 67873a6
Merge branch 'main' into refactor/per-library-logger
ramakrishnap-nv f100932
refactor(logger): cut the cross-library API down to what is actually …
ramakrishnap-nv a0a9628
fix(logger): configure the solver's logger from run_mip too
ramakrishnap-nv 5977aad
chore(ci): trim the logger symbol check comments
ramakrishnap-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* clang-format off */ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| /* clang-format on */ | ||
|
|
||
| #include <utilities/logger.hpp> | ||
|
|
||
| /* | ||
| * The logger itself is header-only and hidden, so it is private to each component library. | ||
| * This translation unit is compiled into cuopt_mathopt only, which is what makes the | ||
| * functions below reach mathopt's instance and no other. | ||
| */ | ||
| namespace cuopt::mathematical_optimization { | ||
|
|
||
| void configure_logging(const std::string& log_file, bool log_to_console, bool truncate) | ||
| { | ||
| cuopt::configure_logging_impl(log_file, log_to_console, truncate); | ||
| } | ||
|
|
||
| void reset_logging() { cuopt::reset_logging_impl(); } | ||
|
|
||
| } // namespace cuopt::mathematical_optimization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* clang-format off */ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| /* clang-format on */ | ||
|
|
||
| #include <utilities/logger.hpp> | ||
|
|
||
| /* | ||
| * The logger itself is header-only and hidden, so it is private to each component library. | ||
| * This translation unit is compiled into cuopt_routing only, which is what makes the | ||
| * functions below reach routing's instance and no other. | ||
| */ | ||
| namespace cuopt::routing { | ||
|
|
||
| void configure_logging(const std::string& log_file, bool log_to_console, bool truncate) | ||
| { | ||
| cuopt::configure_logging_impl(log_file, log_to_console, truncate); | ||
| } | ||
|
|
||
| void reset_logging() { cuopt::reset_logging_impl(); } | ||
|
|
||
| } // namespace cuopt::routing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.