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
7bde1c6b
Commit
7bde1c6b
authored
Aug 16, 2017
by
Francois Tessier
Browse files
Add debug messages in the custom printf feature
parent
ee3350c4
Changes
2
Show whitespace changes
Inline
Side-by-side
tp_utils.cpp
View file @
7bde1c6b
...
@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) {
...
@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) {
#endif
#endif
break
;
break
;
case
TIMING
:
case
TIMING
:
#ifdef TIMING
#ifdef COLOR
#ifdef COLOR
fprintf
(
stdout
,
BLUE
"[TIME]"
RESET
" %s"
,
message
);
fprintf
(
stdout
,
BLUE
"[TIME]"
RESET
" %s"
,
message
);
#else
#else
fprintf
(
stdout
,
"[TIME] %s"
,
message
);
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
#endif
break
;
break
;
default:
default:
...
...
tp_utils.hpp
View file @
7bde1c6b
...
@@ -6,11 +6,12 @@
...
@@ -6,11 +6,12 @@
#define RED "\x1b[31m"
#define RED "\x1b[31m"
#define GREEN "\x1b[32m"
#define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define YELLOW "\x1b[33m"
#define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define RESET "\x1b[0m"
#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
,
...
);
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