Ice 3.8
Slice API Reference
Loading...
Searching...
No Matches
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"]
16module Ice
17{
18 /// Represents the different types of log messages.
20 {
21 /// A print message.
22 ["swift:identifier:printMessage"]
24
25 /// A trace message.
26 ["swift:identifier:traceMessage"]
28
29 /// A warning message.
30 ["swift:identifier:warningMessage"]
32
33 /// An error message.
34 ["swift:identifier:errorMessage"]
36 }
37
38 /// A sequence of {@link LogMessageType}.
39 sequence<LogMessageType> LogMessageTypeSeq;
40
41 /// Represents a full log message.
43 {
44 /// The type of this log message.
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).
50
51 /// For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
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.
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.
107 RemoteLogger* prx,
108 LogMessageTypeSeq messageTypes,
109 StringSeq traceCategories,
110 int messageMax)
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.
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.
131 LogMessageTypeSeq messageTypes,
132 StringSeq traceCategories,
133 int messageMax,
134 out string prefix);
135 }
136}
Thrown when a remote logger with the same identity is already attached to the Logger admin facet.
bool detachRemoteLogger(RemoteLogger *prx)
Detaches a RemoteLogger object from the local logger.
LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax, out string prefix)
Retrieves the most recent log messages cached by this facet, oldest first.
void attachRemoteLogger(RemoteLogger *prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax)
Attaches a RemoteLogger object to the local logger, then calls RemoteLogger::init on prx.
Provides remote access to the log messages of a communicator's logger.
void init(string prefix, LogMessageSeq logMessages)
Initializes this remote logger with the prefix and the most recent log messages of the logger of the ...
void log(LogMessage message)
Receives a log message that matches the filters given to LoggerAdmin::attachRemoteLogger.
Receives the log messages sent by the Logger admin facet of a communicator.
sequence< LogMessage > LogMessageSeq
A sequence of LogMessage.
LogMessageType
Represents the different types of log messages.
@ ErrorMessage
An error message.
@ PrintMessage
A print message.
@ WarningMessage
A warning message.
@ TraceMessage
A trace message.
sequence< LogMessageType > LogMessageTypeSeq
A sequence of LogMessageType.
sequence< string > StringSeq
A sequence of strings.
The Ice RPC framework.
LogMessageType type
The type of this log message.
string traceCategory
For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
long timestamp
The date and time when the application logged this message, expressed as the number of microseconds s...
string message
The log message itself.
Represents a full log message.