Skip to content

feat: implement logger hook#267

Merged
Swatinem merged 1 commit intogetsentry:masterfrom
Mixaill:logger-hook
Jun 4, 2020
Merged

feat: implement logger hook#267
Swatinem merged 1 commit intogetsentry:masterfrom
Mixaill:logger-hook

Conversation

@Mixaill
Copy link
Copy Markdown
Contributor

@Mixaill Mixaill commented May 31, 2020

add ability to create logger hook

void logger_hook(sentry_level_t level, const char* message, va_list args)
{
    char buf[1024]{};
    vsprintf(buf, message, args);
    OutputDebugStringA(buf);
}

...

void init_sentry() 
{
    sentry_options_t* _options = sentry_options_new();
    sentry_options_set_logger(_options, logger_hook);

   ...
}

fixes #148
references #244

@Mixaill Mixaill force-pushed the logger-hook branch 4 times, most recently from 69da944 to 7d2a023 Compare May 31, 2020 22:01
@jan-auer jan-auer requested a review from Swatinem June 2, 2020 07:50
Copy link
Copy Markdown
Contributor

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Just some minor things.

@Mixaill Mixaill force-pushed the logger-hook branch 3 times, most recently from ecf9d5e to 4cf26ee Compare June 3, 2020 17:35
@Mixaill Mixaill force-pushed the logger-hook branch 2 times, most recently from 92d768c to f43d8b9 Compare June 3, 2020 19:11
@Mixaill
Copy link
Copy Markdown
Contributor Author

Mixaill commented Jun 3, 2020

clang-format support in MSVS is the worst thing I've ever seen. :(

Copy link
Copy Markdown
Contributor

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff! Thanks for doing this ;-)

@Swatinem Swatinem merged commit aca8890 into getsentry:master Jun 4, 2020
@Swatinem Swatinem mentioned this pull request Jun 4, 2020
@Mixaill Mixaill deleted the logger-hook branch June 11, 2020 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add logger callback for SENTRY_LOGF

2 participants