Commit a3d81eed authored by Zachary T Welch's avatar Zachary T Welch
Browse files

support OPENOCD_DEBUG_LEVEL environment setting

Detect the OPENOCD_DEBUG_LEVEL setting in log_init(), allowing the
very early startup phases to be debugged.
parent be482a53
......@@ -346,6 +346,19 @@ void log_init(void)
if (debug_level == -1)
debug_level = LOG_LVL_INFO;
char *debug_env = getenv("OPENOCD_DEBUG_LEVEL");
if (NULL != debug_env)
{
int value;
int retval = parse_int(debug_env, &value);
if (ERROR_OK == retval &&
debug_level >= LOG_LVL_SILENT &&
debug_level <= LOG_LVL_DEBUG)
{
debug_level = value;
}
}
if (log_output == NULL)
log_output = stderr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment