Ice
3.8
Slice API Reference
Toggle main menu visibility
Loading...
Searching...
No Matches
Ice
RemoteLogger.ice
1
// Copyright (c) ZeroC, Inc.
2
3
#pragma once
4
5
[[
"cpp:dll-export:ICE_API"
]]
6
[[
"cpp:doxygen:include:Ice/Ice.h"
]]
7
[[
"cpp:header-ext:h"
]]
8
9
[[
"cpp:include:list"
]]
10
11
[[
"js:module:@zeroc/ice"
]]
12
13
#include "BuiltinSequences.ice"
14
15
[
"java:identifier:com.zeroc.Ice"
]
16
module
Ice
17
{
18
/// Represents the different types of log messages.
19
enum
LogMessageType
20
{
21
/// A print message.
22
[
"swift:identifier:printMessage"
]
23
PrintMessage
,
24
25
/// A trace message.
26
[
"swift:identifier:traceMessage"
]
27
TraceMessage
,
28
29
/// A warning message.
30
[
"swift:identifier:warningMessage"
]
31
WarningMessage
,
32
33
/// An error message.
34
[
"swift:identifier:errorMessage"
]
35
ErrorMessage
36
}
37
38
/// A sequence of {@link LogMessageType}.
39
sequence<LogMessageType>
LogMessageTypeSeq
;
40
41
/// Represents a full log message.
42
struct
LogMessage
43
{
44
/// The type of this log message.
45
LogMessageType
type
;
46
47
/// The date and time when the application logged this message, expressed as the number of microseconds since
48
/// the Unix Epoch (00:00:00 UTC on 1 January 1970).
49
long
timestamp
;
50
51
/// For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
52
string
traceCategory
;
53
54
/// The log message itself.
55
string
message
;
56
}
57
58
/// A sequence of {@link LogMessage}.
59
[
"cpp:type:std::list<LogMessage>"
]
60
sequence<LogMessage>
LogMessageSeq
;
61
62
/// Receives the log messages sent by the Logger admin facet of a communicator.
63
/// @see LoggerAdmin#attachRemoteLogger
64
interface
RemoteLogger
65
{
66
/// Initializes this remote logger with the prefix and the most recent log messages of the logger of the
67
/// communicator that hosts the Logger admin facet. This facet calls this operation once, after
68
/// {@link LoggerAdmin::attachRemoteLogger} attaches this remote logger.
69
/// @param prefix The prefix of that logger.
70
/// @param logMessages The most recent log messages cached by the Logger admin facet that match the filters
71
/// given to {@link LoggerAdmin::attachRemoteLogger}, oldest first, up to its `messageMax`. This sequence is
72
/// empty when `messageMax` is 0.
73
[
"swift:identifier:initialize"
]
74
void
init
(
string
prefix,
LogMessageSeq
logMessages);
75
76
/// Receives a log message that matches the filters given to {@link LoggerAdmin::attachRemoteLogger}.
77
/// @param message The log message.
78
/// @remark The Logger admin facet can call {@link log} before {@link init}, even though the log messages
79
/// passed to {@link init} are older.
80
void
log
(
LogMessage
message);
81
}
82
83
/// Thrown when a remote logger with the same identity is already attached to the Logger admin facet.
84
exception
RemoteLoggerAlreadyAttachedException
85
{
86
}
87
88
/// Provides remote access to the log messages of a communicator's logger. The Logger admin facet implements this
89
/// interface. An Ice application attaches a {@link RemoteLogger} to receive these messages, or calls
90
/// {@link getLog} to retrieve the cached ones.
91
interface
LoggerAdmin
92
{
93
/// Attaches a {@link RemoteLogger} object to the local logger, then calls {@link RemoteLogger::init} on
94
/// @p prx. This facet detaches the remote logger when a call to it fails.
95
/// @param prx A proxy to the remote logger.
96
/// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
97
/// no filtering (send all message types).
98
/// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
99
/// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
100
/// (send all trace categories).
101
/// @param messageMax The maximum number of cached log messages (of all types) to be provided to
102
/// {@link RemoteLogger::init}. A negative value requests all the cached messages, and 0 requests none. This
103
/// parameter does not limit the log messages sent to {@link RemoteLogger::log}.
104
/// @throws RemoteLoggerAlreadyAttachedException Thrown when a remote logger with the identity of @p prx is
105
/// already attached to this facet.
106
void
attachRemoteLogger
(
107
RemoteLogger
* prx,
108
LogMessageTypeSeq
messageTypes,
109
StringSeq
traceCategories,
110
int
messageMax)
111
throws
RemoteLoggerAlreadyAttachedException
;
112
113
/// Detaches a {@link RemoteLogger} object from the local logger.
114
/// @param prx A proxy to the remote logger. This facet uses only the identity of this proxy.
115
/// @return `true` if a remote logger with this identity was attached and is now detached, and `false`
116
/// otherwise.
117
bool
detachRemoteLogger
(
RemoteLogger
* prx);
118
119
/// Retrieves the most recent log messages cached by this facet, oldest first. The properties
120
/// `Ice.Admin.Logger.KeepLogs` and `Ice.Admin.Logger.KeepTraces` set how many log messages it caches.
121
/// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
122
/// filtering (send all message types).
123
/// @param traceCategories The categories of traces that the caller wishes to receive. This parameter is
124
/// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering (send
125
/// all trace categories).
126
/// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
127
/// requests all the cached messages, and 0 requests none.
128
/// @param prefix The prefix of the associated local logger.
129
/// @return The log messages.
130
LogMessageSeq
getLog
(
131
LogMessageTypeSeq
messageTypes,
132
StringSeq
traceCategories,
133
int
messageMax,
134
out
string
prefix);
135
}
136
}
Ice::RemoteLoggerAlreadyAttachedException
Thrown when a remote logger with the same identity is already attached to the Logger admin facet.
Definition
RemoteLogger.ice:85
Ice::LoggerAdmin::detachRemoteLogger
bool detachRemoteLogger(RemoteLogger *prx)
Detaches a RemoteLogger object from the local logger.
Ice::LoggerAdmin::getLog
LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax, out string prefix)
Retrieves the most recent log messages cached by this facet, oldest first.
Ice::LoggerAdmin::attachRemoteLogger
void attachRemoteLogger(RemoteLogger *prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax)
Attaches a RemoteLogger object to the local logger, then calls RemoteLogger::init on prx.
Ice::LoggerAdmin
Provides remote access to the log messages of a communicator's logger.
Definition
RemoteLogger.ice:92
Ice::RemoteLogger::init
void init(string prefix, LogMessageSeq logMessages)
Initializes this remote logger with the prefix and the most recent log messages of the logger of the ...
Ice::RemoteLogger::log
void log(LogMessage message)
Receives a log message that matches the filters given to LoggerAdmin::attachRemoteLogger.
Ice::RemoteLogger
Receives the log messages sent by the Logger admin facet of a communicator.
Definition
RemoteLogger.ice:65
Ice::LogMessageSeq
sequence< LogMessage > LogMessageSeq
A sequence of LogMessage.
Definition
RemoteLogger.ice:60
Ice::LogMessageType
LogMessageType
Represents the different types of log messages.
Definition
RemoteLogger.ice:20
Ice::ErrorMessage
@ ErrorMessage
An error message.
Definition
RemoteLogger.ice:35
Ice::PrintMessage
@ PrintMessage
A print message.
Definition
RemoteLogger.ice:23
Ice::WarningMessage
@ WarningMessage
A warning message.
Definition
RemoteLogger.ice:31
Ice::TraceMessage
@ TraceMessage
A trace message.
Definition
RemoteLogger.ice:27
Ice::LogMessageTypeSeq
sequence< LogMessageType > LogMessageTypeSeq
A sequence of LogMessageType.
Definition
RemoteLogger.ice:39
Ice::StringSeq
sequence< string > StringSeq
A sequence of strings.
Definition
BuiltinSequences.ice:46
Ice
The Ice RPC framework.
Definition
BuiltinSequences.ice:23
Ice::LogMessage::type
LogMessageType type
The type of this log message.
Definition
RemoteLogger.ice:45
Ice::LogMessage::traceCategory
string traceCategory
For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
Definition
RemoteLogger.ice:52
Ice::LogMessage::timestamp
long timestamp
The date and time when the application logged this message, expressed as the number of microseconds s...
Definition
RemoteLogger.ice:49
Ice::LogMessage::message
string message
The log message itself.
Definition
RemoteLogger.ice:55
Ice::LogMessage
Represents a full log message.
Definition
RemoteLogger.ice:43
Generated by
1.18.0