kopia lustrzana https://github.com/solokeys/solo1
Print logging and debugging messages to stderr
rodzic
ccce555c63
commit
0c4fbb7ed9
|
@ -72,7 +72,7 @@ void LOG(uint32_t tag, const char * filename, int num, const char * fmt, ...)
|
|||
{
|
||||
if (tag & tagtable[i].tagn)
|
||||
{
|
||||
if (tagtable[i].tag[0] && !(tag & TAG_NO_TAG)) printf("[%s] ", tagtable[i].tag);
|
||||
if (tagtable[i].tag[0] && !(tag & TAG_NO_TAG)) fprintf(stderr, "[%s] ", tagtable[i].tag);
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -86,12 +86,12 @@ void LOG(uint32_t tag, const char * filename, int num, const char * fmt, ...)
|
|||
#ifdef ENABLE_FILE_LOGGING
|
||||
if (tag & TAG_FILENO)
|
||||
{
|
||||
printf("%s:%d: ", filename, num);
|
||||
fprintf(stderr, "%s:%d: ", filename, num);
|
||||
}
|
||||
#endif
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vprintf(fmt, args);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ void dump_hex(uint8_t * buf, int size)
|
|||
{
|
||||
while(size--)
|
||||
{
|
||||
printf("%02x ", *buf++);
|
||||
fprintf(stderr, "%02x ", *buf++);
|
||||
}
|
||||
printf("\n");
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ void usbhid_close()
|
|||
void int_handler(int i)
|
||||
{
|
||||
usbhid_close();
|
||||
printf("SIGINT... exiting.\n");
|
||||
fprintf(stderr, "SIGINT... exiting.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ void authenticator_initialize()
|
|||
uint8_t * mem;
|
||||
if (access(state_file, F_OK) != -1)
|
||||
{
|
||||
printf("state file exists\n");
|
||||
fprintf(stderr, "state file exists\n");
|
||||
f = fopen(state_file, "rb");
|
||||
if (f== NULL)
|
||||
{
|
||||
|
@ -398,7 +398,7 @@ void authenticator_initialize()
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("state file does not exist, creating it\n");
|
||||
fprintf(stderr, "state file does not exist, creating it\n");
|
||||
f = fopen(state_file, "wb+");
|
||||
if (f== NULL)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue