Skip to content

ESP_LOGX is broken with no suitable alternative #4264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
az-z opened this issue Aug 17, 2020 · 2 comments
Closed

ESP_LOGX is broken with no suitable alternative #4264

az-z opened this issue Aug 17, 2020 · 2 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@az-z
Copy link

az-z commented Aug 17, 2020

ESP_LOGX, as well as, all related "infrastructure" has been broken for a while now.
we can not assign TAGS, nor control the amount of logging per unit in any other way, but changing CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL app level variable.

Based on the discussion in #585 (closed) the solution was introduced -> to use log_x .
Unfortunately, log_x is not a replacement, but a "hack".
In addition, this hack broke esp_log_write() and esp_log_set_vprintf() functionality.

static const char *TAG = "AW";
...

int double_vprintf(const char *fmt, va_list args) {

	char buffer[256];
	int ret = vsnprintf (buffer, sizeof(buffer), fmt, args);
	ESP_LOGI("from withing double_vprintf...");

// The following requires AWS_IOT library and configuration for AWS and MQQT. But you can reproduce the same "not working" situation by poiinting to a file
	if (hornbill.publish(TOPIC_NAME,buffer) != 0) {
		Serial.println("Sending data from double_vprintf() failed");
		ESP_LOGE("Sending data from double_vprintf() failed");
	};
	return vprintf(fmt, args);
}


void setup() {
	delay(3000);
	Serial.begin(9600);

	esp_log_level_set("*",ESP_LOG_INFO);
	esp_log_level_set(TAG,ESP_LOG_INFO);
	esp_log_level_set("WIFI",TAG,ESP_LOG_INFO);

...
	esp_log_set_vprintf(double_vprintf);
	ESP_LOGI(TAG," INFO");
	ESP_LOGE(TAG,"ERROR - why do i see it? I set to INFO only!");
	esp_log_set_vprintf(double_vprintf);
}


@stale
Copy link

stale bot commented Oct 17, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Oct 17, 2020
@stale
Copy link

stale bot commented Oct 31, 2020

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

1 participant