1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24#ifndef __com_sun_star_logging_XLogHandler_idl__ 25#define __com_sun_star_logging_XLogHandler_idl__ 26 27#ifndef __com_sun_star_lang_XComponent_idl__ 28#include <com/sun/star/lang/XComponent.idl> 29#endif 30 31#ifndef __com_sun_star_logging_LogRecord_idl__ 32#include <com/sun/star/logging/LogRecord.idl> 33#endif 34 35#ifndef __com_sun_star_logging_XLogFormatter_idl__ 36#include <com/sun/star/logging/XLogFormatter.idl> 37#endif 38 39//============================================================================= 40 41module com { module sun { module star { module logging { 42 43//============================================================================= 44 45/** provides possibilites to send <type>LogRecord</type>s to an arbitrary output 46 channel. 47 48 @see XLogger 49 50 @since OpenOffice 2.3 51 */ 52published interface XLogHandler 53{ 54 /** allows life time control for the handler 55 56 <p>Disposing the handler effectively means closing the channel 57 to which the handler forwards the log records. 58 */ 59 interface ::com::sun::star::lang::XComponent; 60 61 /** specifies MIME charset name for the encoding to be used by this handler 62 63 <p>It depends on the concrete handler implementation whether or not this 64 parameter is needed.<p> 65 66 @see http://www.iana.org/assignments/character-sets 67 */ 68 [attribute] string Encoding; 69 70 /** specifies the formatter to be used by this handler. 71 */ 72 [attribute] XLogFormatter Formatter; 73 74 /** specifies the log level of this handler 75 76 <p>Different handlers can have different log levels, which again might be 77 different from the log level of the <type>XLogger</type> for which the handlers 78 are used.</p> 79 */ 80 [attribute] long Level; 81 82 /** flushes all buffered output of the handler 83 84 <p>Log handlers are allowed to buffer their output. Upon <code>flush</code> 85 being called, they must flush all their buffers.</p> 86 */ 87 void flush(); 88 89 /** publish the given log record at the handler's output channel. 90 91 @return 92 <TRUE/> if and only if the record was actually published. A handler 93 will not publish a record if its log level doesn't meet the handler's 94 log level, if the record is filtered, or if any other handler-specified 95 restrictions apply. 96 */ 97 boolean publish( [in] LogRecord Record ); 98}; 99 100//============================================================================= 101 102}; }; }; }; 103 104//============================================================================= 105 106#endif 107