[dpdk-dev] [PATCH v4] log: respect rte_openlog_stream calls before rte_eal_init

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Oct 12 21:47:32 CEST 2016


2016-10-12 12:38, John Ousterhout:
> @@ -127,6 +125,19 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
>  {
>  	int ret;
>  	FILE *f = rte_logs.file;
> +	if (f == NULL) {
> +		f = default_log_stream;
> +		if (f == NULL) {
> +			/*
> +			 * Grab the current value of stderr here, rather than
> +			 * just initializing default_log_stream to stderr. This
> +			 * ensures that we will always use the current value
> +			 * of stderr, even if the application closes and
> +			 * reopens it.
> +			 */
> +			f = stderr;
> +		}
> +	}

I don't understand this big comment.
What is the difference with initializing default_log_stream to stderr?
What do you mean by "if the application closes and reopens it"?


More information about the dev mailing list