Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 645773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:32:22+00:00 2026-05-13T21:32:22+00:00

I just started using Pantheios and it feels really like a great library for

  • 0

I just started using Pantheios and it feels really like a great library for logging! Maybe even the greatest one for C++! Congratulations to the author!

However, I could not find neither in the documentation nor in all the forum posts anything about how to include the calling class and the line number in the log.

I’m using be.file as back end and I defined custom front end, looking at the example of fe.simple. Is this something to do with the PANTHEIOS_EXTERN_C const char PANTHEIOS_FE_PROCESS_IDENTITY[] or I’m on a completely wrong way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:32:23+00:00Added an answer on May 13, 2026 at 9:32 pm

    The answer for this actually is in the FAQ file included in the library download. I have a fixed-back-end DLL that has the following header in it and I am able to include the class, function and line number in the log file.

    #include <pantheios/pantheios.hpp>
    #include <pantheios/frontends/fe.N.h>
    //#include <pantheios/frontends/fe.simple.h>
    #ifndef PANTHEIOS_INCL_PANTHEIOS_H_TRACE
    #define PANTHEIOS_TRACE_PREFIX         __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): " __FUNCTION__ ": "
    #endif /* PANTHEIOS_INCL_PANTHEIOS_H_TRACE */
    #include <pantheios/trace.h>
    #include <pantheios/inserters.hpp>
    #include <pantheios/backends/bec.file.h>    // be.file header
    

    What is happening here is that you have to redefine PANTHEIOS_TRACE_PREFIX before including trace.h, which is what I have shown above. The other lines of code are included simply to show you where the #define goes. And sorry for the delayed response. If you wish I could post a download on my blog with a fixed-back-end DLL project that anyone could use in their solution for simple file-based logging. Leave a comment if you have any interest in that project

    Update 2/28/2010 12:53 AM CST: For your reference here is the question from the FAQ:

    Q9: “Does Pantheios provide a configuration that yields a logged message
    containing the containing function, equivalent to:

       log(informational, __FUNCTION__, ": my message");
    

    without having to write that (or some wrapper that checks for compiler support).” [15th March 2008]

    A9:
    You need to #define PANTHEIOS_TRACE_PREFIX to what you want. By default
    it is __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): ", which gives the
    format <file>(<line>):

    To include the function, lets says you want it to have the format <file>(<line>): <func>:. To achieve this you’d define it as follows:

    #include <pantheios/pantheios.h>
    #define PANTHEIOS_TRACE_PREFIX         __FILE__ " " PANTHEIOS_STRINGIZE(__LINE__) ": " __FUNCTION__ ": "
    #include <pantheios/trace.h>
    

    Note that the definition must come before the inclusion of pantheios/trace.h. Therefore, a safer way of doing this is as follows:

    /* File: myPantheiosRootHeader.h */
    #include <pantheios/pantheios.h>
    
    #ifdef PANTHEIOS_INCL_PANTHEIOS_H_TRACE
    # error pantheios/trace.h must not be included before myPantheiosRootHeader.h
    #endif /* PANTHEIOS_INCL_PANTHEIOS_H_TRACE */
    
    #define PANTHEIOS_TRACE_PREFIX         __FILE__ " " PANTHEIOS_STRINGIZE(__LINE__) ": " __FUNCTION__ ": "
    #include <pantheios/trace.h>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 344k
  • Answers 344k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It declares two overloaded functions named test, one taking a… May 14, 2026 at 5:39 am
  • Editorial Team
    Editorial Team added an answer typedef std::vector<registeredObject>::iterator iterator; typedef std::vector<registeredObject>::const_iterator const_iterator; std::vector<registeredObject>::iterator begin(void); std::vector<registeredObject>::const_iterator begin(void)… May 14, 2026 at 5:39 am
  • Editorial Team
    Editorial Team added an answer Couple things: Your class is named Bar but you're calling… May 14, 2026 at 5:39 am

Related Questions

I just started using GNU Emacs as my text editor and I am concerned
I just started using the WPF WebBrowser that is included in Net 3.5 SP1.
I just started using SVN, and I have a cache directory that I don't
I just started using CCNet, and in the process of getting my build projects
I just started using TestDriven.NET to debug on my tests, here is my setup

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.