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 /// The {@link RemoteLogger} received a print message.
22 ["swift:identifier:printMessage"]
24
25 /// The {@link RemoteLogger} received a trace message.
26 ["swift:identifier:traceMessage"]
28
29 /// The {@link RemoteLogger} received a warning message.
30 ["swift:identifier:warningMessage"]
32
33 /// The {@link RemoteLogger} received 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 message sent to the {@link RemoteLogger}.
46
47 /// The date and time when the {@link RemoteLogger} received this message, expressed as the number of
48 /// microseconds since 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 /// Represents an Ice object that accepts log messages. It's called by the implementation of {@link LoggerAdmin}.
63 interface RemoteLogger
64 {
65 /// Attaches a remote logger to the local logger.
66 /// @param prefix The prefix of the associated local Logger.
67 /// @param logMessages Old log messages generated before "now".
68 ["swift:identifier:initialize"]
69 void init(string prefix, LogMessageSeq logMessages);
70
71 /// Logs a LogMessage.
72 /// @param message The message to log.
73 /// @remark {@link log} may be called by {@link LoggerAdmin} before {@link init}.
74 void log(LogMessage message);
75 }
76
77 /// Thrown when the provided {@link RemoteLogger} was previously attached to a {@link LoggerAdmin}.
81
82 /// Represents the admin facet that allows an Ice application to attach its {@link RemoteLogger} to the local
83 /// logger of an Ice communicator.
84 interface LoggerAdmin
85 {
86 /// Attaches a {@link RemoteLogger} object to the local logger. This operation calls {@link RemoteLogger::init}
87 /// on @p prx.
88 /// @param prx A proxy to the remote logger.
89 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
90 /// no filtering (send all message types).
91 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
92 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
93 /// (send all trace categories).
94 /// @param messageMax The maximum number of log messages (of all types) to be provided to
95 /// {@link RemoteLogger::init}. A negative value requests all messages available.
96 /// @throws RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
97 /// object.
99 RemoteLogger* prx,
100 LogMessageTypeSeq messageTypes,
101 StringSeq traceCategories,
102 int messageMax)
104
105 /// Detaches a {@link RemoteLogger} object from the local logger.
106 /// @param prx A proxy to the remote logger.
107 /// @return `true` if the provided remote logger proxy was detached, and `false` otherwise.
109
110 /// Retrieves recently logged log messages.
111 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
112 /// filtering (send all message types).
113 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
114 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
115 /// categories).
116 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
117 /// requests all messages available.
118 /// @param prefix The prefix of the associated local logger.
119 /// @return The Log messages.
121 LogMessageTypeSeq messageTypes,
122 StringSeq traceCategories,
123 int messageMax,
124 out string prefix);
125 }
126}
Thrown when the provided RemoteLogger was previously attached to a LoggerAdmin.
bool detachRemoteLogger(RemoteLogger *prx)
Detaches a RemoteLogger object from the local logger.
LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax, out string prefix)
Retrieves recently logged log messages.
void attachRemoteLogger(RemoteLogger *prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, int messageMax)
Attaches a RemoteLogger object to the local logger.
Represents the admin facet that allows an Ice application to attach its RemoteLogger to the local log...
void init(string prefix, LogMessageSeq logMessages)
Attaches a remote logger to the local logger.
void log(LogMessage message)
Logs a LogMessage.
Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdmin.
sequence< LogMessage > LogMessageSeq
A sequence of LogMessage.
LogMessageType
Represents the different types of log messages.
@ ErrorMessage
The RemoteLogger received an error message.
@ PrintMessage
The RemoteLogger received a print message.
@ WarningMessage
The RemoteLogger received a warning message.
@ TraceMessage
The RemoteLogger received 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 message sent to the RemoteLogger.
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 RemoteLogger received this message, expressed as the number of microsecond...
string message
The log message itself.
Represents a full log message.