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