Skip to content

Commit 48a2587

Browse files
committed
stop logspam a bit
1 parent 1bbca0b commit 48a2587

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

common/droidboot_logging.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ void droidboot_log(droidboot_log_level log_level, const char *fmt, ...){
2222
if(log_level>=DROIDBOOT_LOG_LEVEL){
2323
va_list args;
2424
char printbuffer[512];
25-
#ifdef DROIDBOOT_ON_SCREEN_LOG
26-
va_start(args, fmt);
27-
vsnprintf(printbuffer, 512, fmt, args);
28-
va_end(args);
29-
droidboot_platform_on_screen_log(printbuffer);
30-
#endif
25+
if(log_level>=DROIDBOOT_ON_SCREEN_LOG) {
26+
va_start(args, fmt);
27+
vsnprintf(printbuffer, 512, fmt, args);
28+
va_end(args);
29+
droidboot_platform_on_screen_log(printbuffer);
30+
}
3131
#ifdef DROIDBOOT_SYSTEM_LOG
3232
va_start(args, fmt);
3333
vsnprintf(printbuffer, 512, fmt, args);

droidboot_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
// DROIDBOOT_ON_SCREEN_LOG can be 1 or 0, enables droidboot related loggging on screen, only for debuggigng and early days.
2+
// DROIDBOOT_ON_SCREEN_LOG can be 0-5 where 0 - trace, 1 - info, 2 - warning, 3 - error, 4 - fail, 5 - nothing
33
#define DROIDBOOT_ON_SCREEN_LOG 1
44

55
// DROIDBOOT_SYSTEM_LOG can be 1 or 0, enables logging with printf wich is usually handled at platform side. Recomended.

dualboot_gui/dualboot_menu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct boot_entry *selected_entry;
3131

3232
static void event_handler(lv_event_t * e)
3333
{
34-
droidboot_log(DROIDBOOT_LOG_INFO, "dualboot menu: got event\n");
34+
droidboot_log(DROIDBOOT_LOG_TRACE, "dualboot menu: got event\n");
3535
lv_event_code_t code = lv_event_get_code(e);
3636
lv_obj_t * obj = lv_event_get_target(e);
3737
int index = lv_obj_get_child_id(obj);
@@ -57,13 +57,13 @@ static void event_handler(lv_event_t * e)
5757
no_autoboot=true;
5858

5959
droidboot_exit=1;
60-
droidboot_log(DROIDBOOT_LOG_INFO, "droidboot_menu: exit is: %d\n", droidboot_exit);
60+
droidboot_log(DROIDBOOT_LOG_TRACE, "droidboot_menu: exit is: %d\n", droidboot_exit);
6161
}
6262
}
6363

6464
static void disable_autoboot_func(lv_event_t * e)
6565
{
66-
droidboot_log(DROIDBOOT_LOG_INFO, "droidboot_menu: got event\n");
66+
droidboot_log(DROIDBOOT_LOG_TRACE, "droidboot_menu: got event\n");
6767
no_autoboot = true;
6868
}
6969

storage/droidboot_gpt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ droidboot_error droidboot_parse_gpt_on_sd()
130130

131131
// get a dma aligned and padded block to read info
132132
char *buf = malloc(droidboot_sd_blklen()*2);
133-
droidboot_log(DROIDBOOT_LOG_INFO, "SD card blklen: %d, blkcnt: %d\n", droidboot_sd_blklen(), droidboot_sd_blkcnt());
133+
droidboot_log(DROIDBOOT_LOG_TRACE, "SD card blklen: %d, blkcnt: %d\n", droidboot_sd_blklen(), droidboot_sd_blkcnt());
134134
/* sniff for MBR partition types */
135135
unsigned int i, j, n;
136136
int gpt_partitions_exist = 0;
@@ -144,9 +144,9 @@ droidboot_error droidboot_parse_gpt_on_sd()
144144
/* see if a partition table makes sense here */
145145
struct mbr_part part[4];
146146
memcpy(part, buf + 446, sizeof(part));
147-
droidboot_log(DROIDBOOT_LOG_INFO, "mbr partition table dump:\n");
147+
droidboot_log(DROIDBOOT_LOG_TRACE, "mbr partition table dump:\n");
148148
for (i=0; i < 4; i++) {
149-
droidboot_log(DROIDBOOT_LOG_INFO, "\t%i: status 0x%hhx, type 0x%hhx, start 0x%x, len 0x%x\n", i, part[i].status, part[i].type, part[i].lba_start, part[i].lba_length);
149+
droidboot_log(DROIDBOOT_LOG_TRACE, "\t%i: status 0x%hhx, type 0x%hhx, start 0x%x, len 0x%x\n", i, part[i].status, part[i].type, part[i].lba_start, part[i].lba_length);
150150
}
151151

152152
/* validate each of the partition entries */
@@ -184,7 +184,7 @@ droidboot_error droidboot_parse_gpt_on_sd()
184184
uint32_t part_entry_cnt = droidboot_sd_blklen() / ENTRY_SIZE;
185185
uint64_t partition_0 = GET_LLWORD_FROM_BYTE(&buf[PARTITION_ENTRIES_OFFSET]);
186186
/* Read GPT Entries */
187-
droidboot_log(DROIDBOOT_LOG_INFO, "Partition entries offset: %d\n", partition_0);
187+
droidboot_log(DROIDBOOT_LOG_TRACE, "Partition entries offset: %d\n", partition_0);
188188
for (i = 0; i < (DROIDBOOT_ROUNDUP(gpthdr.max_partition_count, part_entry_cnt)) / part_entry_cnt; i++) {
189189
droidboot_sd_read_block(buf, 2 + i, 1);
190190
droidboot_dump_hex(DROIDBOOT_LOG_TRACE, buf, 16);

0 commit comments

Comments
 (0)