File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
// (c) Copyright 2011 Dean Michael Berris.
5
5
// Copyright 2012 Google, Inc.
6
+ // Copyright 2012 A. Joel Lamotte
6
7
// Distributed under the Boost Software License, Version 1.0.
7
8
// (See accompanying file LICENSE_1_0.txt or copy at
8
9
// http://www.boost.org/LICENSE_1_0.txt)
11
12
print out network-related errors through standard error. This is only
12
13
useful when NETWORK_DEBUG is turned on. Otherwise the macro amounts to a
13
14
no-op.
15
+ The user can force the logging to be enabled by defining NETWORK_ENABLE_LOG.
14
16
*/
15
- #ifdef NETWORK_DEBUG
16
- # include < iostream>
17
+ #if defined(NETWORK_DEBUG) && !defined(NETWORK_ENABLE_LOGGING)
18
+ # define NETWORK_ENABLE_LOGGING
19
+ #endif
20
+
21
+ #ifdef NETWORK_ENABLE_LOGGING
22
+
23
+ # include < network/logging/logging.hpp>
17
24
# ifndef NETWORK_MESSAGE
18
- # define NETWORK_MESSAGE (msg ) std::cerr << " [DEBUG " << __FILE__ << ' :' << __LINE__ << " ]: " << msg << std::endl ;
25
+ # define NETWORK_MESSAGE (msg ) network::logging::log_record() << " [network " << __FILE__ << ' :' << __LINE__ << " ]: " << msg;
19
26
# endif
27
+
20
28
#else
29
+
21
30
# ifndef NETWORK_MESSAGE
22
31
# define NETWORK_MESSAGE (msg )
23
32
# endif
33
+
24
34
#endif
25
35
36
+
26
37
#endif /* end of include guard: NETWORK_DEBUG_HPP_20110410 */
Original file line number Diff line number Diff line change
1
+ // Copyright 2011 A. Joel Lamotte <mjklaim@gmail.com>.
2
+ // Distributed under the Boost Software License, Version 1.0.
3
+ // (See accompanying file LICENSE_1_0.txt or copy at
4
+ // http://www.boost.org/LICENSE_1_0.txt)
5
+
1
6
#ifndef NETWORK_LOGGING_HPP_20121112
2
7
#define NETWORK_LOGGING_HPP_20121112
3
8
Original file line number Diff line number Diff line change 1
1
# Copyright (c) Glyn Matthews 2011, 2012.
2
2
# Copyright 2011 Dean Michael Berris (dberris@google.com)
3
+ # Copyright 2012 A. Joel Lamotte (mjklaim@gmail.com)
3
4
# Copyright 2011 Google, Inc.
4
5
# Distributed under the Boost Software License, Version 1.0.
5
6
# (See accompanying file LICENSE_1_0.txt or copy at
Original file line number Diff line number Diff line change
1
+ // Copyright 2011 A. Joel Lamotte <mjklaim@gmail.com>.
2
+ // Distributed under the Boost Software License, Version 1.0.
3
+ // (See accompanying file LICENSE_1_0.txt or copy at
4
+ // http://www.boost.org/LICENSE_1_0.txt)
5
+
1
6
#ifdef NETWORK_NO_LIB
2
7
#undef NETWORK_NO_LIB
3
8
#endif
You can’t perform that action at this time.
0 commit comments