Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CoMISo
Base
Commits
badb563a
Commit
badb563a
authored
7 years ago
by
Martin Marinov
Browse files
Options
Downloads
Patches
Plain Diff
Hook the progress active node tick to some of DEB_ macros. Add the PROGRESS_ABORTED error.
parent
89d448ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Debug/DebOut.hh
+29
-23
29 additions, 23 deletions
Debug/DebOut.hh
Utils/BaseErrorInc.hh
+1
-0
1 addition, 0 deletions
Utils/BaseErrorInc.hh
with
30 additions
and
23 deletions
Debug/DebOut.hh
+
29
−
23
View file @
badb563a
...
...
@@ -3,21 +3,26 @@
#ifndef BASE_DEBOUT_HH_INCLUDED
#define BASE_DEBOUT_HH_INCLUDED
#ifdef PROGRESS_ON
#include
"Base/Progress/ProgressNode.hh"
#else//PROGRESS_ON
#define PROGRESS_ACTIVE_TICK
#endif//PROGRESS_ON
// DEB_ON is defined, or not, in CMakeLists.txt for primary project
#ifndef DEB_ON
#define DEB_module(SS)
#define DEB_enter_func
#define DEB_enter_func
PROGRESS_ACTIVE_TICK;
#define DEB_only(CC)
#define DEB_exec(LL, AA) {}
#define DEB_exec_if(CC, LL, AA) {}
#define DEB_out(LL, AA) {}
#define DEB_out_if(CC, LL, AA) {}
#define DEB_line(LL, AA) {}
#define DEB_line_if(CC, LL, AA) {}
#define DEB_warning(LL, AA) {}
#define DEB_warning_if(CC, LL, AA) {}
#define DEB_mesh_if(CC, LL, FF, MM) {}
#define DEB_exec(LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_exec_if(CC, LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_out(LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_out_if(CC, LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_line(LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_line_if(CC, LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_warning(LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_warning_if(CC, LL, AA) { PROGRESS_ACTIVE_TICK; }
#define DEB_error(AA) {}
#define DEB_error_if(CC, AA) {}
...
...
@@ -130,27 +135,29 @@ std::string to_string(const T& _t)
#define DEB_module(MODULE)
//TODO: This should use an atomic thread-safe static int(s)
#define DEB_enter_func static int deb_nmbr = 0; \
#define DEB_enter_func PROGRESS_ACTIVE_TICK; \
static int deb_nmbr = 0; \
static int deb_lvl = Debug::INVALID_LEVEL; \
::Debug::Enter deb(__FILE__, __FUNCTION__, deb_nmbr, deb_lvl);
#define DEB_only(CC) CC
#define DEB_exec(LL, AA) DEB_exec_if(true, LL, AA)
#define DEB_exec_if(CC, LL, AA) { if (deb.pass(LL) && (CC)) { AA; } }
#define DEB_exec_if(CC, LL, AA) { PROGRESS_ACTIVE_TICK; \
{ if (deb.pass(LL) && (CC)) { AA; } } }
#define DEB_out(LL, AA) DEB_out_if(true, LL, AA)
#define DEB_out_if(CC, LL, AA) {
if (deb.pass(LL) && (CC))
\
{ deb.stream() << AA << ::Base::Command::END; } }
#define DEB_out_if(CC, LL, AA) {
PROGRESS_ACTIVE_TICK;
\
{
if (deb.pass(LL) && (CC)) {
deb.stream() << AA << ::Base::Command::END; } }
}
#define DEB_line(LL, AA) DEB_line_if(true, LL, AA)
#define DEB_line_if(CC, LL, AA) {
if (deb.pass(LL) && (CC))
\
{ deb.stream() << AA << ::Base::LF; } }
#define DEB_line_if(CC, LL, AA) {
PROGRESS_ACTIVE_TICK;
\
{
if (deb.pass(LL) && (CC)) {
deb.stream() << AA << ::Base::LF; } }
}
#define DEB_warning(LL, AA) DEB_warning_if(true, LL, AA)
#define DEB_warning_if(CC, LL, AA) {
if (deb.pass(LL) && (CC))
\
{ ::Base::OStringStream strm; strm << AA; \
::Debug::warning(strm.str, BASE_CODELINK); } }
#define DEB_warning_if(CC, LL, AA) {
PROGRESS_ACTIVE_TICK;
\
{
if (deb.pass(LL) && (CC)) {
::Base::OStringStream strm; strm << AA; \
::Debug::warning(strm.str, BASE_CODELINK); } }
}
#define DEB_error(AA) { ::Base::OStringStream strm; strm << AA; \
::Debug::error(strm.str, BASE_CODELINK); }
...
...
@@ -164,5 +171,4 @@ std::string to_string(const T& _t)
#define DEB_os_str(AA) Debug::to_string(AA)
#endif // DEB_ON
#endif // BASE_DEBOUT_HH_INCLUDED
This diff is collapsed.
Click to expand it.
Utils/BaseErrorInc.hh
+
1
−
0
View file @
badb563a
...
...
@@ -9,3 +9,4 @@
// and it is not an error code.
DEFINE_ERROR
(
SUCCESS
,
"Success"
)
DEFINE_ERROR
(
TODO
,
"TODO: Undefined error message"
)
DEFINE_ERROR
(
PROGRESS_ABORTED
,
"Progress cancelled"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment