MiKTeX 26.5-next
A scalable TeX distribution
Loading...
Searching...
No Matches
TraceStream.h
1/* miktex/Trace/TraceStream.h: -*- C++ -*-
2
3 Copyright (C) 1996-2020 Christian Schenk
4
5 This file is part of the MiKTeX Trace Library.
6
7 The MiKTeX Trace Library is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2, or
10 (at your option) any later version.
11
12 The MiKTeX Trace Library is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with the MiKTeX Trace Library; if not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22#pragma once
23
24#if !defined(A727BE8FD70B4A9A8E03971A80D27A11)
25#define A727BE8FD70B4A9A8E03971A80D27A11
26
27#include "config.h"
28
29#include <memory>
30#include <string>
31#include <vector>
32
33#include "TraceCallback.h"
34
37MIKTEX_TRACE_BEGIN_NAMESPACE;
38
39class MIKTEXNOVTABLE TraceStream
40{
41public:
42 virtual MIKTEXTHISCALL ~TraceStream() noexcept = 0;
43
44public:
45 virtual void MIKTEXTHISCALL Close() = 0;
46
47public:
48 virtual bool MIKTEXTHISCALL IsEnabled(const std::string& facility, TraceLevel level) = 0;
49
50public:
51 virtual void MIKTEXTHISCALL WriteLine(const std::string& facility, TraceLevel level, const std::string& text) = 0;
52
53public:
54 virtual void MIKTEXTHISCALL WriteLine(const std::string& facility, const std::string& text) = 0;
55
56public:
57 static MIKTEXTRACECEEAPI(std::unique_ptr<TraceStream>) Open(const std::string& name, TraceLevel level, TraceCallback* callback);
58
59public:
60 static MIKTEXTRACECEEAPI(std::unique_ptr<TraceStream>) Open(const std::string& name, TraceCallback* callback);
61
62 // DEPRECATED
63public:
64 static std::unique_ptr<TraceStream> Open(const std::string& name)
65 {
66 return Open(name, nullptr);
67 }
68
69public:
70 static MIKTEXTRACECEEAPI(void) SetOptions(const std::vector<std::string>& options);
71
72public:
73 static MIKTEXTRACECEEAPI(void) SetOptions(const std::string& options);
74
75public:
76 static MIKTEXTRACECEEAPI(std::string) MakeOption(const std::string& name, const std::string& facility, TraceLevel level);
77};
78
79MIKTEX_TRACE_END_NAMESPACE;
80
81#endif
Definition TraceCallback.h:45
Definition TraceStream.h:40