Boost logo

Boost Users :

Subject: [Boost-users] Log: Filter expression in file stream init
From: Florian Lindner (mailinglists_at_[hidden])
Date: 2015-07-19 17:22:42


Hello,

I have this piece of code: http://pastebin.com/iMyyaB6a

It adds a file and a console log and reads in a file config:

[Core]
# Filter="%Severity% > 1"

[Sinks.MyConsoleSink1]
Destination=Console

and prints some messages:

  using namespace boost::log::trivial;
  boost::log::sources::severity_logger<severity_level> lg;
  BOOST_LOG_SEV(lg, trace) << "A trace severity message";
  BOOST_LOG_SEV(lg, debug) << "A debug severity message";
  BOOST_LOG_SEV(lg, info) << "An informational severity message";
  BOOST_LOG_SEV(lg, warning) << "A warning severity message";
  BOOST_LOG_SEV(lg, error) << "An error severity message";
  BOOST_LOG_SEV(lg, fatal) << "A fatal severity message";

It does exactly what I want, prints each message twice to the console. But
when I uncomment the Filter expression it prints nothing.

Why not? Severity > 1 means everything info and above, doesn't it?

Thanks,

Florian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net