Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francois Tessier
TAPIOCA
Commits
0e6e9197
Commit
0e6e9197
authored
Aug 16, 2017
by
Francois Tessier
Browse files
Add debug messages in the custom printf feature
parent
4d7a562f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tp_utils.cpp
View file @
0e6e9197
...
...
@@ -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 @
0e6e9197
...
...
@@ -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
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