Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ITraceMngPolicy.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ITraceMngPolicy.h (C) 2000-2019 */
9/* */
10/* Interface for trace management policy. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_ITRACEMNGPOLICY_H
13#define ARCANE_UTILS_ITRACEMNGPOLICY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Interface for the configuration manager of a trace manager.
30 *
31 * The properties defined by this class are used to initialize
32 * instances of ITraceMng. Modifying a property does not affect
33 * already created ITraceMngs.
34 */
35class ARCANE_UTILS_EXPORT ITraceMngPolicy
36{
37 public:
38
39 virtual ~ITraceMngPolicy() {}
40
41 public:
42
43 //! Constructs the instance
44 virtual void build() = 0;
45 /*!
46 * \brief Initializes \a trace.
47 *
48 * If \a rank is 0, then \a trace is considered the master ITraceMng. In case of listing output, the suffix will have the value \a rank.
49 */
50 virtual void initializeTraceMng(ITraceMng* trace, Int32 rank) = 0;
51
52 /*!
53 * \brief Initializes \a trace with information from the parent \a parent_trace.
54 *
55 * If file outputs are enabled, \a trace will output its information
56 * into a file suffixed by \a file_suffix.
57 * \a parent_trace may be null.
58 */
59 virtual void initializeTraceMng(ITraceMng* trace, ITraceMng* parent_trace,
60 const String& file_suffix) = 0;
61 /*!
62 * \brief Sets the values of the TraceClassConfig of \a trace via
63 * the data contained in \a bytes.
64 *
65 * \a bytes is a buffer containing a character string in XML format
66 * as described in the documentation \ref arcanedoc_execution_traces.
67 *
68 * The instances of TraceClassConfig of \a trace already registered before calling this
69 * method are deleted.
70 */
72
73 /*!
74 * \brief Indicates if parallelism is active.
75 *
76 * This property is set by the application during initialization.
77 */
78 virtual void setIsParallel(bool v) = 0;
79 virtual bool isParallel() const = 0;
80
81 /*!
82 * \brief Indicates if debug outputs are active.
83 *
84 * This property is set by the application during initialization.
85 */
86 virtual void setIsDebug(bool v) = 0;
87 virtual bool isDebug() const = 0;
88
89 /*!
90 * \brief Indicates if all ranks output traces to a file in parallel.
91 */
92 virtual void setIsParallelOutput(bool v) = 0;
93 virtual bool isParallelOutput() const = 0;
94
95 /*!
96 * \brief Verbosity level for the standard output stream (stdout).
97 *
98 * This property is used when calling initializeTraceMng()
99 * to set the verbosity level of standard outputs.
100 */
101 virtual void setStandardOutputVerbosityLevel(Int32 level) = 0;
102 virtual Int32 standardOutputVerbosityLevel() const = 0;
103
104 /*!
105 * \brief Verbosity level.
106 *
107 * This property is used when calling initializeTraceMng()
108 * to set the verbosity level.
109 */
110 virtual void setVerbosityLevel(Int32 level) = 0;
111 virtual Int32 verbosityLevel() const = 0;
112
113 /*!
114 * \brief Indicates if a master ITraceMng outputs traces to a file
115 * in addition to standard output.
116 *
117 * This property defaults to \a false.
118 */
119 virtual void setIsMasterHasOutputFile(bool active) = 0;
120 virtual bool isMasterHasOutputFile() const = 0;
121
122 /*!
123 * Sets the default verbosity level.
124 *
125 * Sets the verbosity levels for \a trace to the level \a minimal_level.
126 * If the verbosity level is already higher than \a minimal_level, nothing
127 * is done.
128 * If \a minimal_level equals Arccore::Trace::UNSPECIFIED_VERBOSITY_LEVEL,
129 * it resets the verbosity level to that specified by verbosityLevel()
130 * and standardOutputVerbosityLevel().
131 */
132 virtual void setDefaultVerboseLevel(ITraceMng* trace, Int32 minimal_level) = 0;
133
134 virtual void setDefaultClassConfigXmlBuffer(ByteConstSpan bytes) = 0;
135};
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140} // End namespace Arcane
141
142/*---------------------------------------------------------------------------*/
143/*---------------------------------------------------------------------------*/
144
145#endif
Interface for the configuration manager of a trace manager.
virtual void setIsParallelOutput(bool v)=0
Indicates if all ranks output traces to a file in parallel.
virtual void initializeTraceMng(ITraceMng *trace, Int32 rank)=0
Initializes trace.
virtual void setIsDebug(bool v)=0
Indicates if debug outputs are active.
virtual void setIsParallel(bool v)=0
Indicates if parallelism is active.
virtual void setClassConfigFromXmlBuffer(ITraceMng *trace, ByteConstArrayView bytes)=0
Sets the values of the TraceClassConfig of trace via the data contained in bytes.
virtual void setIsMasterHasOutputFile(bool active)=0
Indicates if a master ITraceMng outputs traces to a file in addition to standard output.
virtual void setVerbosityLevel(Int32 level)=0
Verbosity level.
virtual void setStandardOutputVerbosityLevel(Int32 level)=0
Verbosity level for the standard output stream (stdout).
virtual void setDefaultVerboseLevel(ITraceMng *trace, Int32 minimal_level)=0
virtual void build()=0
Constructs the instance.
virtual void initializeTraceMng(ITraceMng *trace, ITraceMng *parent_trace, const String &file_suffix)=0
Initializes trace with information from the parent parent_trace.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Span< const std::byte > ByteConstSpan
Read-only view of a 1D array of characters.
Definition UtilsTypes.h:548
ConstArrayView< Byte > ByteConstArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:476
std::int32_t Int32
Signed integer type of 32 bits.