Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Holzer
waLBerla
Commits
e173be3d
Commit
e173be3d
authored
2 years ago
by
Christoph Alt
Committed by
Markus Holzer
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
document logging
parent
4d10e7f2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/logging/CMakeDefs.in.h
+3
-0
3 additions, 0 deletions
src/core/logging/CMakeDefs.in.h
src/core/logging/Logging.cpp
+33
-11
33 additions, 11 deletions
src/core/logging/Logging.cpp
src/core/logging/Logging.h
+1
-1
1 addition, 1 deletion
src/core/logging/Logging.h
with
37 additions
and
12 deletions
src/core/logging/CMakeDefs.in.h
+
3
−
0
View file @
e173be3d
...
...
@@ -12,3 +12,6 @@
#cmakedefine WALBERLA_LOGLEVEL_PROGRESS
#cmakedefine WALBERLA_LOGLEVEL_DETAIL
#cmakedefine WALBERLA_LOGLEVEL_TRACING
#define WALBERLA_LOGLEVEL ${WALBERLA_LOGLEVEL}
#define WALBERLA_LOGLEVEL_STRING "${WALBERLA_LOGLEVEL}"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/core/logging/Logging.cpp
+
33
−
11
View file @
e173be3d
...
...
@@ -43,25 +43,35 @@ const std::string Logging::TRACING_TAG = std::string( "[TRACING ]" );
const
uint_t
Logging
::
TAG_WIDTH
=
uint_t
(
10
);
const
uint_t
Logging
::
TIMESTAMP_WIDTH
=
uint_t
(
17
);
void
Logging
::
setStreamLogLevel
(
LogLevel
logLevel
)
{
#ifndef WALBERLA_LOGLEVEL_INFO
if
(
logLevel
==
INFO
)
logWarning
(
"You are trying to set the stream log level to INFO, but INFO logs are deactivated by CMake!"
,
"Logging::setStreamLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the stream log level to INFO, but INFO logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=INFO to activate INFO logs."
,
"Logging::setStreamLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_PROGRESS
if
(
logLevel
==
PROGRESS
)
logWarning
(
"You are trying to set the stream log level to PROGRESS, but PROGRESS logs are deactivated by CMake!"
,
"Logging::setStreamLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the stream log level to PROGRESS, but PROGRESS logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=PROGRESS to activate PROGRESS logs."
,
"Logging::setStreamLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_DETAIL
if
(
logLevel
==
DETAIL
)
logWarning
(
"You are trying to set the stream log level to DETAIL, but DETAIL logs are deactivated by CMake!"
,
"Logging::setStreamLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the stream log level to DETAIL, but DETAIL logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=DETAIL to activate DETAIL logs."
,
"Logging::setStreamLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_TRACING
if
(
logLevel
==
TRACING
)
logWarning
(
"You are trying to set the stream log level to TRACING, but TRACING logs are deactivated by CMake!"
,
"Logging::setStreamLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the stream log level to TRACING, but TRACING logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=TRACING to activate TRACING logs."
,
"Logging::setStreamLogLevel"
,
-
1
);
#endif
streamLogLevel_
=
logLevel
;
}
...
...
@@ -72,19 +82,31 @@ void Logging::setFileLogLevel( LogLevel logLevel )
{
#ifndef WALBERLA_LOGLEVEL_INFO
if
(
logLevel
==
INFO
)
logWarning
(
"You are trying to set the file log level to INFO, but INFO logs are deactivated by CMake!"
,
"Logging::setFileLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the file log level to INFO, but INFO logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=INFO to activate INFO logs."
,
"Logging::setFileLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_PROGRESS
if
(
logLevel
==
PROGRESS
)
logWarning
(
"You are trying to set the file log level to PROGRESS, but PROGRESS logs are deactivated by CMake!"
,
"Logging::setFileLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the file log level to PROGRESS, but PROGRESS logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=PROGRESS to activate PROGRESS logs."
,
"Logging::setFileLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_DETAIL
if
(
logLevel
==
DETAIL
)
logWarning
(
"You are trying to set the file log level to DETAIL, but DETAIL logs are deactivated by CMake!"
,
"Logging::setFileLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the file log level to DETAIL, but DETAIL logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=DETAIL to activate DETAIL logs."
,
"Logging::setFileLogLevel"
,
-
1
);
#endif
#ifndef WALBERLA_LOGLEVEL_TRACING
if
(
logLevel
==
TRACING
)
logWarning
(
"You are trying to set the file log level to TRACING, but TRACING logs are deactivated by CMake!"
,
"Logging::setFileLogLevel"
,
-
1
);
logWarning
(
"You are trying to set the file log level to TRACING, but TRACING logs are deactivated by CMake!"
"The current WALBERLA_LOGLEVEL is: "
WALBERLA_LOGLEVEL_STRING
"!"
"Set WALBERLA_LOGLEVEL=TRACING to activate TRACING logs."
,
"Logging::setFileLogLevel"
,
-
1
);
#endif
fileLogLevel_
=
logLevel
;
}
...
...
@@ -215,4 +237,4 @@ bool Logging::isInIgnoreCallerPaths( const std::vector< walberla::regex > & rege
}
// namespace logging
}
// namespace walberla
}
// namespace walberla
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/core/logging/Logging.h
+
1
−
1
View file @
e173be3d
...
...
@@ -186,7 +186,7 @@ private:
inline
Logging
::
Logging
()
:
singleton
::
Singleton
<
Logging
>
(),
streamLogLevel_
(
INFO
),
fileLogLevel_
(
INFO
),
streamLogLevel_
(
WALBERLA_LOGLEVEL
),
fileLogLevel_
(
WALBERLA_LOGLEVEL
),
processId_
(
uint_c
(
mpi
::
MPIManager
::
instance
()
->
worldRank
()
)
),
numberOfProcesses_
(
uint_c
(
mpi
::
MPIManager
::
instance
()
->
numProcesses
()
)
),
startTime_
(
timing
::
WcPolicy
::
getTimestamp
()
),
showTimeStamp_
(
true
),
logCallerPath_
(
false
)
...
...
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