~ubuntu-branches/ubuntu/trusty/log4shib/trusty

« back to all changes in this revision

Viewing changes to src/Win32DebugAppender.cpp

  • Committer: Package Import Robot
  • Author(s): Russ Allbery
  • Date: 2012-06-05 21:20:25 UTC
  • Revision ID: package-import@ubuntu.com-20120605212025-uyigtav7dqwvnf41
Tags: upstream-1.0.4
ImportĀ upstreamĀ versionĀ 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Win32DebugAppender.cpp
 
3
 *
 
4
 * Copyright 2002, the Log4cpp project.
 
5
 *
 
6
 * See the COPYING file for the terms of usage and distribution.
 
7
 */
 
8
 
 
9
#ifdef WIN32    // only available on Win32
 
10
 
 
11
#include "PortabilityImpl.hh"
 
12
#ifdef LOG4SHIB_HAVE_IO_H
 
13
#    include <io.h>
 
14
#endif
 
15
 
 
16
#include <windows.h>
 
17
#include <winbase.h>
 
18
 
 
19
#include <stdio.h>
 
20
#include "log4shib/Category.hh"
 
21
#include "log4shib/Win32DebugAppender.hh"
 
22
 
 
23
namespace log4shib {
 
24
 
 
25
    Win32DebugAppender::Win32DebugAppender(const std::string& name) : 
 
26
            LayoutAppender(name) {
 
27
    }
 
28
    
 
29
    Win32DebugAppender::~Win32DebugAppender() {
 
30
        close();
 
31
    }
 
32
 
 
33
    void Win32DebugAppender::close() {
 
34
    }
 
35
 
 
36
    void Win32DebugAppender::_append(const LoggingEvent& event) {
 
37
        std::string message(_getLayout().format(event));
 
38
                ::OutputDebugString(message.c_str());
 
39
    }
 
40
}
 
41
 
 
42
#endif  // WIN32