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#pragma once
23
24#include "config.h"
25
26#include <log.h>
27
28#define NCP_DEBUG_LOG 1
29#define NCP_DEBUG_DUMP 2
30#define LNK_DEBUG_LOG 4
31#define LNK_DEBUG_DUMP 8
32#define PKT_DEBUG_LOG 16
33#define PKT_DEBUG_DUMP 32
34#define PKT_DEBUG_HANDSHAKE 64
35#define NCP_SESSION_LOG 128
36
37// Note that these logs are not thread-safe and there's nothing to ensure that log messages from different threads
38// aren't interlaced. Since these are ultimately written to using `write` logging shouldn't crash, but it's important to
39// understand the limitations.
40
41extern logbuf ilog;
42extern logbuf dlog;
43extern logbuf elog;
44
45extern std::ostream lout;
46extern std::ostream lerr;
47extern std::ostream linf;
A streambuffer, logging via syslog.
Definition: log.h:50
std::ostream lerr
logbuf dlog
std::ostream lout
logbuf elog
std::ostream linf
logbuf ilog