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 3430070
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:09:35+00:00 2026-05-18T07:09:35+00:00

i want to log a lot of events in a dynamically search-algorithm (e.g. information

  • 0

i want to log a lot of events in a dynamically search-algorithm (e.g. information about convergence to global optimum). This logging should have a switch to turn it off/on. Now there are a lot of possibilities to achieve that:

  • implement a log-version and a non-log-version of the algorithm -> redundancy
  • use macros -> ugly and not that safe
  • use a c++ logging library (or: use 1% of the functional range of a logging library).

I decided to use Pantheios, especially because of the performance claims made (don’t want to lose much performance because of this logging, which is only needed in development). I have to admit, that i don’t need much of the functionality of this library, but i thought i would be a much nicer/safer way to use it. Maybe there would be a better suited alternative i don’t know of (i need compile-time decisions only for logging -> don’t know if there are logging-libraries designed for that purpose).

After compiling, installing and finally linking (no success with manually linking, but with the scons building tool; using gcc -> explicit linking), i wanted to try a little example.

Let’s reduce that to something like the following:

#include "pantheios/pantheios.hpp"
#include "pantheios/frontends/stock.h"
const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = "pantheios_test";    // specify process identity

int main()
{
    pantheios::log_ALERT("alert-event");
    pantheios::log_DEBUG("debug-event");
    pantheios::log_INFORMATIONAL("just information");
    return 1;
}

Linking is done with the following files:

LIBS=['pantheios.1.core.gcc44', 'pantheios.1.be.fprintf.gcc44', 'pantheios.1.bec.fprintf.gcc44',
'pantheios.1.fe.all.gcc44', 'pantheios.1.util.gcc44']

The simple question is now: how to switch the console-output off/on? How to choose the severity-level which is given to the back-end?

Looking into the documentation lead me to a lot of functions which take a severity level, but these functions are automatically called once for initialization. I know that dynamic changes of severity-levels are possible. I don’t know exactly, where i change these settings. They should be in the front-end component i think. Is linking to “fe_all” already some kind of decisions which level is logged ad which level isn’t?

It should be relatively easy because in my case, i only need a compile-time decision about logging on/off.

Thanks for your help.

Sascha

  • 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-18T07:09:36+00:00Added an answer on May 18, 2026 at 7:09 am

    Is linking to “fe_all” already some kind of decisions which level is logged ad which level isn’t?

    Short answer: yes.

    fe.all enables all severity levels: “all” meesages are logged.

    If you want better control, try fe.simple. By default it switches on everything in debug builds and everything except DEBUG and INFO in release. You can change the threshold at anytime – in debug or release – by calling the function pantheios_fe_simple_setSeverityThresdhold() (or something similar) in the fe.simple header (which is pantheios/frontends/fe.simple.h, iirc).

    Be aware that Pantheios is described as a logging API library. I think the intention is that it provides an API, initialization control and output over an existing “rich” logging library. That it provides “stock” front-ends and back-ends is a convenience to users for (i) getting up to speed quickly, and (ii) simple requirements (for which your program may qualify).

    btw, I think the Pantheios forums on the project site are pretty well supported, so you may want to post questions there as well as here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a log file that has a lot of tagging information, i.e, ERROR,
I want my logfile to look something like this: 2009-02-13.log but the problem is
I've been searching a lot but I haven't found anything about this question. I'm
i want log linenumber to my log file, using log4net.the config details of log4net
I want to log onto Stack Overflow using OpenID, but I thought I'd set
I want to log user's actions in my Ruby on Rails application. So far,
I want to log to the console when I'm using un-minimized JavaScript files. Comments
I want the log to roll over as long as the application is running,
I want to log all exceptions server side . In ASP.NET I write something
I want to log my log strings to a file. I implemented the following

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.