Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
Main Repositories
otb
Commits
dd762867
Commit
dd762867
authored
7 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
STY: Small change in log message
parent
fcaf2cf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!20
Refactor logging for the whole library
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Core/Common/include/otbMacro.h
+26
-74
26 additions, 74 deletions
Modules/Core/Common/include/otbMacro.h
with
26 additions
and
74 deletions
Modules/Core/Common/include/otbMacro.h
+
26
−
74
View file @
dd762867
...
...
@@ -31,6 +31,7 @@
#include
"itkMacro.h"
#include
"itkObject.h"
#include
"otbConfigure.h"
#include
"otbLogger.h"
/**
* \namespace otb
...
...
@@ -42,86 +43,37 @@ namespace otb
{
}
// end namespace otb - this is here for documentation purposes
/** This macro is used to print debug (or other information). They are
* also used to catch errors, etc. Example usage looks like:
* itkDebugMacro(<< "this is debug info" << this->SomeVariable); */
#define otbDebugMacro(x) itkDebugMacro(x)
/* { if ( this->GetDebug() && *::itk::Object::GetGlobalWarningDisplay()) \
{ std::ostringstream itkmsg; \
itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
<< this->GetNameOfClass() << " (" << this << "): " x \
<< "\n\n"; \
::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); } \
}*/
#define otbMsgDebugMacro(x) \
{ \
if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay()) \
{ \
std::ostringstream itkmsg; \
itkmsg << " Msg Debug: " x << "\n"; \
::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
} \
}
#define otbFileContext(x) \
<< "file " __FILE__ ", line " << __LINE__<<", " x
#ifndef NDEBUG
#define otbGenericMsgDebugMacro(x) \
{ \
if (::itk::Object::GetGlobalWarningDisplay()) \
{ \
std::ostringstream itkmsg; \
itkmsg << " Generic Msg Debug: " x << "\n"; \
::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
} \
}
#else
#define otbGenericMsgDebugMacro(x)
#endif
#define otbClassContext(x) \
<< this->GetNameOfClass() << " (" << this << "): " x
#define otbGenericMsgTestingMacro(x) \
{ \
std::cout x << std::endl; \
}
#define otbLogMacro(level,msg) \
{ \
std::ostringstream itkmsg; \
itkmsg msg << "\n"; \
otb::Logger::Instance()->level(itkmsg.str().c_str()); \
}
#ifdef OTB_SHOW_ALL_MSG_DEBUG
#define otbMsgDevMacro(x) \
{ \
{ \
std::ostringstream itkmsg; \
itkmsg << " Msg Dev: (" << __FILE__ << ":" << __LINE__ << ") " x << "\n"; \
::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
} \
}
#else
#define otbMsgDevMacro(x)
#endif
/** This macro is used to print warning information (i.e., unusual circumstance
* but not necessarily fatal.) Example usage looks like:
* itkWarningMacro(<< "this is warning info" << this->SomeVariable); */
#define otbWarningMacro(x) \
{ \
if (itk::Object::GetGlobalWarningDisplay()) \
{ \
std::ostringstream itkmsg; \
itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
<< this->GetNameOfClass() << " (" << this << "): " x \
<< "\n\n"; \
itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
} \
}
#define otbGenericWarningMacro(x) \
{ \
if (itk::Object::GetGlobalWarningDisplay()) \
{ \
std::ostringstream itkmsg; \
itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << ": " x <<"\n";\
itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
} \
}
#define otbDebugMacro(x) otbLogMacro(Debug,otbFileContext(otbClassContext(x)))
#define otbMsgDebugMacro(x) otbLogMacro(Debug,otbFileContext(x))
#define otbGenericMsgDebugMacro(x) otbLogMacro(Debug,x)
#define otbMsgDevMacro(x) otbLogMacro(Info,otbFileContext(x))
#define otbWarningMacro(x) otbLogMacro(Warning,otbFileContext(otbClassContext(x)))
#define otbGenericWarningMacro(x) otbLogMacro(Warning,otbFileContext(x))
// TODO: Address this macro as well
#define otbGenericMsgTestingMacro(x) \
{ \
std::cout x << std::endl; \
}
/** This macro is used to control condition. It use ONLY by the OTB developers
*
*/
...
...
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