Ability to override specify the source location index. #20

Open
opened 2025-01-26 20:58:15 -05:00 by josh · 0 comments
Owner

Might have to integrate std::stacktrace or something to achieve this, but, in effect, the goal is to be able to call SetStacktrace(2), and the logger will print the second function up in the stacktrace, instead of the current (0th). If your stack trace looks like the following:

int main() {
    void setup() {
        void pre_init_resources() {
                void test_something(int v = 555) {
                    myLogger("Test passed");
                }
        }
    }
}

The source location that gets logged would be setup(), rather than test_something().

Might have to integrate std::stacktrace or something to achieve this, but, in effect, the goal is to be able to call SetStacktrace(2), and the logger will print the second function up in the stacktrace, instead of the current (0th). If your stack trace looks like the following: ``` c++ int main() { void setup() { void pre_init_resources() { void test_something(int v = 555) { myLogger("Test passed"); } } } } ``` The source location that gets logged would be setup(), rather than test_something().
Sign in to join this conversation.
No description provided.