File: sscpp706.cpp

package info (click to toggle)
log4shib 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,948 kB
  • sloc: cpp: 4,778; sh: 4,242; ansic: 818; makefile: 190
file content (25 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <exception>
#include <log4shib/Category.hh>
#include <log4shib/PropertyConfigurator.hh>

#ifdef WIN32
# define DATADIR "."
#endif

int main(int argc, char* argv[])
{
    std::string initFileName = argc > 1 ? argv[1] : DATADIR "/sscpp706.txt";
    try {
        log4shib::PropertyConfigurator::configure(initFileName);
        log4shib::Category& root = log4shib::Category::getRoot();
        root.warn("Storm is coming");
        log4shib::Category::shutdown();
    } catch (const std::exception& ex) {
        std::cout << "Caught exception: " << ex.what() << std::endl;
        return 1;
    }

    return 0;
}