source: trunk/src/halEvent.cpp @ 404

Revision 404, 1.4 KB checked in by Eoin, 12 years ago (diff)

Some threading bug with the LogListView?!

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2008.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#include "stdAfx.hpp"
8#include "Halite.hpp"
9
10#include <iostream>
11#include <fstream>
12#include <iterator>
13#include <iomanip>
14#include <map>
15#include <algorithm>
16#include <string>
17#include <vector>
18
19#include <libtorrent/file.hpp>
20#include <libtorrent/hasher.hpp>
21#include <libtorrent/entry.hpp>
22#include <libtorrent/bencode.hpp>
23#include <libtorrent/session.hpp>
24#include <libtorrent/ip_filter.hpp>
25#include <libtorrent/torrent_handle.hpp>
26#include <libtorrent/peer_connection.hpp>
27
28#include "halEvent.hpp"
29
30namespace hal
31{
32
33void Event::post(boost::shared_ptr<EventDetail> event)
34{
35        if (event->level() != hal::Event::debug || halite().logDebug())
36                signal(event);
37}
38       
39std::wstring Event::eventLevelToStr(eventLevel event)
40{
41        switch (event)
42        {
43        case debug:
44                return hal::app().res_wstr(HAL_EVENTDEBUG);
45        case info:
46                return hal::app().res_wstr(HAL_EVENTINFO);
47        case warning:
48                return hal::app().res_wstr(HAL_EVENTWARNING);
49        case critical:
50                return hal::app().res_wstr(HAL_EVENTCRITICAL);
51        case fatal:
52                return hal::app().res_wstr(HAL_EVENTCRITICAL);
53        default:
54                return hal::app().res_wstr(HAL_EVENTNONE);
55        }
56}
57
58Event& event()
59{
60        static Event e;
61        return e;
62}
63
64} // namespace hal
Note: See TracBrowser for help on using the repository browser.