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

  • SEARCH
  • Home
  • 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

Related Questions

I just started using Boost::xpressive and find it an excellent library... I went through
I've just started using PLINQO which looks really good so far. The only problem
I just started using CakePHP, and am learning how to use Bake. Why does
I just started using Doxygen to generate documentation for my libraries and I found
I just started using datatables (java script) for tabular data, due to js I
We just started using hg and we're using base tags for common modules in
I just started using XNA Framework 4.0 today, and I was wondering what the
I just started using the new project type SQL Server 2008 Database. I can
I have just started using services in Android and I have a made a
I've just started using jQuery, but am a bit stuck. I am building a

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.