File: BasicConfigurator.cpp

package info (click to toggle)
log4shib 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,968 kB
  • sloc: cpp: 4,786; sh: 4,242; ansic: 818; makefile: 193
file content (35 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (7)
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
26
27
28
29
30
31
32
33
34
35
/*
 * BasicConfigurator.cpp
 *
 * Copyright 2002, Log4cpp Project. All rights reserved.
 *
 * See the COPYING file for the terms of usage and distribution.
 */
#include "PortabilityImpl.hh"

#ifdef LOG4SHIB_HAVE_IO_H
#    include <io.h>
#endif
#ifdef LOG4SHIB_HAVE_UNISTD_H
#    include <unistd.h>
#endif

#include <cstdio>
#include <log4shib/BasicConfigurator.hh>
#include <log4shib/Category.hh>
#include <log4shib/FileAppender.hh>
#include <log4shib/Priority.hh>

namespace log4shib {

    void BasicConfigurator::configure() {
        Category& root = Category::getRoot();
        root.setPriority(Priority::INFO);
        root.removeAllAppenders();
        root.addAppender(new FileAppender("_", ::dup(fileno(stdout))));
    }

}