forked from dkales/dpf-cpp
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.cpp
More file actions
Latest commit
27 lines (22 loc) · 587 Bytes
/
Copy pathLog.cpp
File metadata and controls
27 lines (22 loc) · 587 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include"Log.h"
#include<cstdarg>
#include<cstdio>
voidLog::v(constchar* tag, constchar *format, ...) {
if(LOGGING_VERBOSE) {
va_list args;
va_start(args, format);
printf("[%s] ", tag);
vprintf(format, args);
printf("\n");
}
}
voidLog::v(constchar *tag, const block &b) {
if(LOGGING_VERBOSE) {
printf("[%s] ", tag);
for (size_t i = 0; i < sizeof(block); i++) {
// for(ssize_t i = sizeof(block)-1; i >= 0; i--) {
printf("%02X", ((uint8_t *) &b)[i]);
}
printf("\n");
}
}