client_wrapper.hxx, socket_wrapper.hxx: reorder member initialization order
[libt2n] / src / client.cpp
... / ...
CommitLineData
1/*
2Copyright (C) 2006 by Intra2net AG - Gerd v. Egidy
3
4The software in this package is distributed under the GNU General
5Public License version 2 (with a special exception described below).
6
7A copy of GNU General Public License (GPL) is included in this distribution,
8in the file COPYING.GPL.
9
10As a special exception, if other files instantiate templates or use macros
11or inline functions from this file, or you compile this file and link it
12with other works to produce a work based on this file, this file
13does not by itself cause the resulting work to be covered
14by the GNU General Public License.
15
16However the source code for this file must still be made available
17in accordance with section (3) of the GNU General Public License.
18
19This exception does not invalidate any other reasons why a work based
20on this file might be covered by the GNU General Public License.
21*/
22#include <sstream>
23
24#include "client.hxx"
25
26namespace libt2n
27{
28
29client_connection::client_connection()
30 : connection()
31{
32 set_logging(NULL,none);
33}
34
35/// get pointer to logging stream, returns NULL if no logging needed
36std::ostream* client_connection::get_logstream(log_level_values level)
37{
38 if (logstream && log_level >= level)
39 return logstream;
40 else
41 return NULL;
42}
43
44/// activate logging to the given stream. everything above the given level is logged.
45void client_connection::set_logging(std::ostream *_logstream, log_level_values _log_level)
46{
47 log_level=_log_level;
48 logstream=_logstream;
49}
50
51};