Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
4bf087c5
Commit
4bf087c5
authored
Nov 20, 2018
by
Dominik Charousset
Committed by
Dominik Charousset
Nov 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove magic numbers from CMake
parent
c848d5f6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
37 deletions
+45
-37
CMakeLists.txt
CMakeLists.txt
+3
-15
Jenkinsfile
Jenkinsfile
+1
-1
cmake/build_config.hpp.in
cmake/build_config.hpp.in
+3
-1
configure
configure
+1
-2
libcaf_core/caf/detail/log_level.hpp
libcaf_core/caf/detail/log_level.hpp
+37
-0
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+0
-18
No files found.
CMakeLists.txt
View file @
4bf087c5
...
...
@@ -367,23 +367,11 @@ endif()
# setup logging #
################################################################################
# make sure log level is defined and all-uppercase
if
(
NOT CAF_LOG_LEVEL
)
set
(
CAF_LOG_LEVEL
"QUIET"
)
endif
()
# set human-readable representation for log level
if
(
CAF_LOG_LEVEL STREQUAL
"ERROR"
)
set
(
CAF_LOG_LEVEL_INT 3
)
elseif
(
CAF_LOG_LEVEL STREQUAL
"WARNING"
)
set
(
CAF_LOG_LEVEL_INT 6
)
elseif
(
CAF_LOG_LEVEL STREQUAL
"INFO"
)
set
(
CAF_LOG_LEVEL_INT 9
)
elseif
(
CAF_LOG_LEVEL STREQUAL
"DEBUG"
)
set
(
CAF_LOG_LEVEL_INT 12
)
elseif
(
CAF_LOG_LEVEL STREQUAL
"TRACE"
)
set
(
CAF_LOG_LEVEL_INT 15
)
else
()
s
et
(
CAF_LOG_LEVEL_INT 0
)
s
tring
(
TOUPPER
"
${
CAF_LOG_LEVEL
}
"
CAF_LOG_LEVEL
)
endif
()
################################################################################
...
...
@@ -713,7 +701,7 @@ if(NOT CAF_NO_SUMMARY)
"
\n
Build static only:
${
CAF_BUILD_STATIC_ONLY
}
"
"
\n
Build static runtime:
${
CAF_BUILD_STATIC_RUNTIME
}
"
"
\n
Runtime checks:
${
CAF_ENABLE_RUNTIME_CHECKS
}
"
"
\n
Log level:
${
LOG_LEVEL_STR
}
"
"
\n
Log level:
${
CAF_LOG_LEVEL
}
"
"
\n
With mem. mgmt.:
${
CAF_BUILD_MEM_MANAGEMENT
}
"
"
\n
With exceptions:
${
CAF_BUILD_WITH_EXCEPTIONS
}
"
"
\n
"
...
...
Jenkinsfile
View file @
4bf087c5
...
...
@@ -17,7 +17,7 @@ releaseBuildFlags = defaultBuildFlags + [
debugBuildFlags
=
defaultBuildFlags
+
[
'CAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
,
'CAF_ENABLE_ADDRESS_SANITIZER:BOOL=yes'
,
'CAF_LOG_LEVEL:STRING=
4
'
,
'CAF_LOG_LEVEL:STRING=
TRACE
'
,
]
// Our build matrix. The keys are the operating system labels and the values
...
...
cmake/build_config.hpp.in
View file @
4bf087c5
...
...
@@ -19,9 +19,11 @@
#pragma once
#include "caf/detail/log_level.hpp"
// this header is auto-generated by CMake
#define CAF_LOG_LEVEL
@CAF_LOG_LEVEL_INT
@
#define CAF_LOG_LEVEL
CAF_LOG_LEVEL_@CAF_LOG_LEVEL
@
#cmakedefine CAF_NO_MEM_MANAGEMENT
...
...
configure
View file @
4bf087c5
...
...
@@ -282,8 +282,7 @@ while [ $# -ne 0 ]; do
append_cache_entry CAF_IOS_DEPLOYMENT_TARGET STRING
"
$optarg
"
;;
--with-log-level
=
*
)
level
=
`
echo
"
$optarg
"
|
tr
'[:lower:]'
'[:upper:]'
`
append_cache_entry CAF_LOG_LEVEL STRING
"
$level
"
append_cache_entry CAF_LOG_LEVEL STRING
"
$optarg
"
;;
--with-clang
=
*
)
clang
=
"
$optarg
"
...
...
libcaf_core/caf/detail/log_level.hpp
0 → 100644
View file @
4bf087c5
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
/// Integer value for the QUIET log level.
#define CAF_LOG_LEVEL_QUIET 0
/// Integer value for the ERROR log level.
#define CAF_LOG_LEVEL_ERROR 3
/// Integer value for the WARNING log level.
#define CAF_LOG_LEVEL_WARNING 6
/// Integer value for the INFO log level.
#define CAF_LOG_LEVEL_INFO 9
/// Integer value for the DEBUG log level.
#define CAF_LOG_LEVEL_DEBUG 12
/// Integer value for the TRACE log level.
#define CAF_LOG_LEVEL_TRACE 15
libcaf_core/caf/logger.hpp
View file @
4bf087c5
...
...
@@ -390,24 +390,6 @@ bool operator==(const logger::field& x, const logger::field& y);
// -- macro constants ----------------------------------------------------------
/// Integer value for the QUIET log level.
#define CAF_LOG_LEVEL_QUIET 0
/// Integer value for the ERROR log level.
#define CAF_LOG_LEVEL_ERROR 3
/// Integer value for the WARNING log level.
#define CAF_LOG_LEVEL_WARNING 6
/// Integer value for the INFO log level.
#define CAF_LOG_LEVEL_INFO 9
/// Integer value for the DEBUG log level.
#define CAF_LOG_LEVEL_DEBUG 12
/// Integer value for the TRACE log level.
#define CAF_LOG_LEVEL_TRACE 15
/// Expands to a no-op.
#define CAF_VOID_STMT static_cast<void>(0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment