/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ module com { module sun { module star { module logging { interface XLogHandler; /** implemented by a component which is able to log events.
This interface is roughly designed after the Java Logging API. However, there are some differences, the major ones being:
When an event is logged, the logger will create a LogRecord for this event, and pass this record to all registered handlers. Single handlers might or might not log those records at their own discretion, and depending on additional restrictions such as filters specified at handler level.
Note: The log level of the given handler (XLogHandler::Level) will not be touched. In particular, it will not be set to the logger's log level. It's the responsibility of the component which knits a logger with one or more log handlers to ensure that all loggers have appropriate levels set.
@param LogHandler the handler to add to the list of handlers. The call is ignored if this parameter is `NULL`. */ void addLogHandler( [in] XLogHandler LogHandler ); /** removes the given handler from the list of handlers. @param LogHandler the handler to remove from the list of handlers. The call is ignored if this parameter is `NULL`, or if the handler has not previously been added. */ void removeLogHandler( [in] XLogHandler LogHandler ); /** determines whether logger instance would produce any output for the given level.The method can be used to optimize performance as maybe complex parameter evaluation
in the log
calls can be omitted if isLoggable
evaluates to false.