Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francois Tessier
TAPIOCA
Commits
7bde1c6b
Commit
7bde1c6b
authored
Aug 16, 2017
by
Francois Tessier
Browse files
Add debug messages in the custom printf feature
parent
ee3350c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
tp_utils.cpp
View file @
7bde1c6b
...
...
@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) {
#endif
break
;
case
TIMING
:
#ifdef TIMING
#ifdef COLOR
fprintf
(
stdout
,
BLUE
"[TIME]"
RESET
" %s"
,
message
);
#else
fprintf
(
stdout
,
"[TIME] %s"
,
message
);
#endif
#endif
break
;
case
DEBUG
:
#ifdef DBG
#ifdef COLOR
fprintf
(
stdout
,
MAGENTA
"[DEBUG]"
RESET
" %s"
,
message
);
#else
fprintf
(
stdout
,
"[ERR] %s"
,
message
);
#endif
#endif
break
;
default:
...
...
tp_utils.hpp
View file @
7bde1c6b
...
...
@@ -6,11 +6,12 @@
#define RED "\x1b[31m"
#define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define RESET "\x1b[0m"
typedef
enum
{
ERROR
,
WARNING
,
INFO
,
TIMING
}
msg_t
;
typedef
enum
{
ERROR
,
WARNING
,
INFO
,
TIMING
,
DEBUG
}
msg_t
;
void
printMsg
(
msg_t
type
,
char
*
format
,
...
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment