Wrap log_x in a function

sorokolokarim
Posts: 2
Joined: Thu Aug 12, 2021 10:53 pm

Wrap log_x in a function

Postby sorokolokarim » Fri Aug 13, 2021 12:02 am

Hi masters. I am a beginner in programming and I ask for your help to help me solve a problem that has been tiring me for several days. I would like to provide the arguments of the log_x through a function. But I can't do it.
Example:
void foo(const char* test, ...)
{
log_x(test, ...);
}

int x = 5;
foo("help: %d", x); // expected: [x][fileName][line]foo() : help: 5

Thanks you for your help.

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: Wrap log_x in a function

Postby ESP_Sprite » Fri Aug 13, 2021 2:59 am

This might give you some ideas on how to do this. It depends on the existence of some vlog_x function, not sure if you have that.

sorokolokarim
Posts: 2
Joined: Thu Aug 12, 2021 10:53 pm

Re: Wrap log_x in a function

Postby sorokolokarim » Fri Aug 13, 2021 9:12 pm

The answer is certainly on a higher level than mine. But through it I will try to find my solution. Otherwise I will come back. Thank you😊

Who is online

Users browsing this forum: No registered users and 75 guests