Skip to content
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

epee: misc_log_ex.h can now be used in C code #5909

Merged
merged 1 commit into from Sep 24, 2019

Conversation

@moneromooo-monero
Copy link
Contributor

commented Sep 11, 2019

use mfatal/merror/mwarning/minfo/mdebug/mtrace

@moneromooo-monero

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

(to be used in the monerod randomx integration code)

free(p);
}

void mfatal(const char *category, const char *fmt, ...) { va_list ap; va_start(ap, fmt); mlog(el::Level::Fatal, category, fmt, ap); va_end(ap); }

This comment has been minimized.

Copy link
@vtnerd

vtnerd Sep 12, 2019

Contributor

Surprised you didn't just macro this repetitive code.

return;
}

MCLOG(level, category, p);

This comment has been minimized.

Copy link
@vtnerd

vtnerd Sep 12, 2019

Contributor

Put a try { } catch (...) {} around this, otherwise we have functions with C linkage throwing. A return value for failure (caught exception) could be helpful too.

@@ -472,4 +472,40 @@ void reset_console_color() {

}

static void mlog(el::Level level, const char *category, const char *format, va_list ap)

This comment has been minimized.

Copy link
@vtnerd

vtnerd Sep 12, 2019

Contributor

Add noexcept (this function is not marked with C linkage).

@moneromooo-monero moneromooo-monero force-pushed the moneromooo-monero:logc branch 2 times, most recently from 6000118 to 006e8a7 Sep 12, 2019
@vtnerd
vtnerd approved these changes Sep 13, 2019
@hyc
hyc approved these changes Sep 13, 2019
@hyc hyc referenced this pull request Sep 17, 2019
use mfatal/merror/mwarning/minfo/mdebug/mtrace
@moneromooo-monero moneromooo-monero force-pushed the moneromooo-monero:logc branch from 006e8a7 to 8933955 Sep 24, 2019
luigi1111 added a commit that referenced this pull request Sep 24, 2019
8933955 epee: misc_log_ex.h can now be used in C code (moneromooo-monero)
@luigi1111 luigi1111 merged commit 8933955 into monero-project:master Sep 24, 2019
0 of 2 checks passed
0 of 2 checks passed
buildbot/monero-static-win32 Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.