mirror of
https://github.com/esphome/esphome.git
synced 2026-05-25 02:16:13 +08:00
[core] Fix ANSI codes for secret text hiding (#15521)
This commit is contained in:
+1
-1
@@ -1083,7 +1083,7 @@ def command_config(args: ArgsProtocol, config: ConfigType) -> int | None:
|
||||
# add the console decoration so the front-end can hide the secrets
|
||||
if not args.show_secrets:
|
||||
output = re.sub(
|
||||
r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[5m\2\\033[6m", output
|
||||
r"(password|key|psk|ssid)\: (.+)", r"\1: \\033[8m\2\\033[28m", output
|
||||
)
|
||||
if not CORE.quiet:
|
||||
safe_print(output)
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ namespace esphome {
|
||||
#define ESPHOME_LOG_COLOR_CYAN "36" // DEBUG
|
||||
#define ESPHOME_LOG_COLOR_GRAY "37" // VERBOSE
|
||||
#define ESPHOME_LOG_COLOR_WHITE "38"
|
||||
#define ESPHOME_LOG_SECRET_BEGIN "\033[5m"
|
||||
#define ESPHOME_LOG_SECRET_END "\033[6m"
|
||||
#define ESPHOME_LOG_SECRET_BEGIN "\033[8m"
|
||||
#define ESPHOME_LOG_SECRET_END "\033[28m"
|
||||
#define LOG_SECRET(x) ESPHOME_LOG_SECRET_BEGIN x ESPHOME_LOG_SECRET_END
|
||||
|
||||
#define ESPHOME_LOG_COLOR(COLOR) "\033[0;" COLOR "m"
|
||||
|
||||
Reference in New Issue
Block a user