plptools
Loading...
Searching...
No Matches
ncp_log.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (C) 1999 Philip Proudman <philip.proudman@btinternet.com>
5 * Copyright (C) 1999-2002 Fritz Elfert <felfert@to.com>
6 * Copyright (C) 2026 Jason Morley <hello@jbmorley.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22#ifndef _ncp_log_h_
23#define _ncp_log_h_
24
25#include "config.h"
26
27#include <log.h>
28
29#define NCP_DEBUG_LOG 1
30#define NCP_DEBUG_DUMP 2
31#define LNK_DEBUG_LOG 4
32#define LNK_DEBUG_DUMP 8
33#define PKT_DEBUG_LOG 16
34#define PKT_DEBUG_DUMP 32
35#define PKT_DEBUG_HANDSHAKE 64
36#define NCP_SESSION_LOG 128
37
38// Note that these logs are not thread-safe and there's nothing to ensure that log messages from different threads
39// aren't interlaced. Since these are ultimately written to using `write` logging shouldn't crash, but it's important to
40// understand the limitations.
41
42extern logbuf ilog;
43extern logbuf dlog;
44extern logbuf elog;
45
46extern std::ostream lout;
47extern std::ostream lerr;
48extern std::ostream linf;
49
50#endif
A streambuffer, logging via syslog.
Definition: log.h:51
std::ostream lerr
logbuf dlog
std::ostream lout
logbuf elog
std::ostream linf
logbuf ilog