Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
8c82136a
Unverified
Commit
8c82136a
authored
Oct 02, 2018
by
Robert Kimball
Committed by
GitHub
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print the entire path of the file printing relative to the project root (#1723)
parent
bcddc600
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
CMakeLists.txt
CMakeLists.txt
+2
-0
log.hpp
src/ngraph/log.hpp
+8
-4
No files found.
CMakeLists.txt
View file @
8c82136a
...
...
@@ -278,6 +278,8 @@ if (NGRAPH_HALIDE)
include
(
cmake/external_halide.cmake
)
endif
()
add_definitions
(
-DPROJECT_ROOT_DIR=
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
add_subdirectory
(
src
)
if
(
NGRAPH_UNIT_TEST_ENABLE
)
...
...
src/ngraph/log.hpp
View file @
8c82136a
...
...
@@ -56,6 +56,10 @@ namespace ngraph
}
constexpr
const
char
*
get_file_name
(
ConstString
s
)
{
return
find_last
(
s
,
'/'
);
}
constexpr
const
char
*
trim_file_name
(
ConstString
root
,
ConstString
s
)
{
return
s
.
get_ptr
(
root
.
size
());
}
enum
class
LOG_TYPE
{
_LOG_TYPE_ERROR
,
...
...
@@ -102,21 +106,21 @@ namespace ngraph
#define NGRAPH_ERR \
ngraph::LogHelper(ngraph::LOG_TYPE::_LOG_TYPE_ERROR, \
ngraph::
get_file_name(__FILE__),
\
ngraph::
trim_file_name(PROJECT_ROOT_DIR, __FILE__),
\
__LINE__, \
ngraph::default_logger_handler_func) \
.stream()
#define NGRAPH_WARN \
ngraph::LogHelper(ngraph::LOG_TYPE::_LOG_TYPE_WARNING, \
ngraph::
get_file_name(__FILE__),
\
ngraph::
trim_file_name(PROJECT_ROOT_DIR, __FILE__),
\
__LINE__, \
ngraph::default_logger_handler_func) \
.stream()
#define NGRAPH_INFO \
ngraph::LogHelper(ngraph::LOG_TYPE::_LOG_TYPE_INFO, \
ngraph::
get_file_name(__FILE__),
\
ngraph::
trim_file_name(PROJECT_ROOT_DIR, __FILE__),
\
__LINE__, \
ngraph::default_logger_handler_func) \
.stream()
...
...
@@ -124,7 +128,7 @@ namespace ngraph
#ifdef NGRAPH_DEBUG_ENABLE
#define NGRAPH_DEBUG \
ngraph::LogHelper(ngraph::LOG_TYPE::_LOG_TYPE_DEBUG, \
ngraph::
get_file_name(__FILE__),
\
ngraph::
trim_file_name(PROJECT_ROOT_DIR, __FILE__),
\
__LINE__, \
ngraph::default_logger_handler_func) \
.stream()
...
...
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