Merge branch 'feature/add_console_log_save' into 'master'

feat: add console log save

See merge request sdk/ESP8266_RTOS_SDK!634
This commit is contained in:
Dong Heng
2018-12-05 11:17:06 +08:00
3 changed files with 51 additions and 4 deletions

View File

@ -244,4 +244,12 @@ config ESPTOOLPY_ENABLE_TIME
help
Enable this option, time string will be added at the head of serial input data line.
config ESPTOOLPY_ENABLE_SAVELOG
bool "Enable console log save"
default n
help
Enable this option, all console output will auto-save to current 'log' directory which same level as the 'build` directory;
if 'log' directory is not exist, will create it.
All console output will be saved as a log filename, named PROJECT_NAME + timestamp.log, which PROJECT_NAME defined in your demo Makefile.
endmenu

View File

@ -13,6 +13,12 @@ else
ENABLE_TIME := n
endif
ifdef CONFIG_ESPTOOLPY_ENABLE_SAVELOG
ENABLE_SAVELOG := y
else
ENABLE_SAVELOG := n
endif
CONFIG_ESPTOOLPY_COMPRESSED ?=
PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
@ -99,7 +105,7 @@ endif
simple_monitor: $(call prereq_if_explicit,%flash)
$(MONITOR_PYTHON) -m serial.tools.miniterm --rts 0 --dtr 0 --raw $(ESPPORT) $(MONITORBAUD)
MONITOR_OPTS := --baud $(MONITORBAUD) --port $(ESPPORT) --toolchain-prefix $(CONFIG_TOOLPREFIX) --make "$(MAKE)" --enable-time $(ENABLE_TIME)
MONITOR_OPTS := --baud $(MONITORBAUD) --port $(ESPPORT) --toolchain-prefix $(CONFIG_TOOLPREFIX) --make "$(MAKE)" --enable-time $(ENABLE_TIME) --enable-savelog $(ENABLE_SAVELOG)
monitor: $(call prereq_if_explicit,%flash)
$(summary) MONITOR