From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- offapi/com/sun/star/logging/ConsoleHandler.idl | 68 +++++++++++ offapi/com/sun/star/logging/CsvLogFormatter.idl | 54 ++++++++ offapi/com/sun/star/logging/FileHandler.idl | 83 +++++++++++++ offapi/com/sun/star/logging/LogLevel.idl | 77 ++++++++++++ offapi/com/sun/star/logging/LogRecord.idl | 84 +++++++++++++ offapi/com/sun/star/logging/LoggerPool.idl | 43 +++++++ offapi/com/sun/star/logging/PlainTextFormatter.idl | 50 ++++++++ .../com/sun/star/logging/SimpleTextFormatter.idl | 49 ++++++++ offapi/com/sun/star/logging/XConsoleHandler.idl | 55 +++++++++ offapi/com/sun/star/logging/XCsvLogFormatter.idl | 69 +++++++++++ offapi/com/sun/star/logging/XLogFormatter.idl | 73 +++++++++++ offapi/com/sun/star/logging/XLogHandler.idl | 92 ++++++++++++++ offapi/com/sun/star/logging/XLogger.idl | 136 +++++++++++++++++++++ offapi/com/sun/star/logging/XLoggerPool.idl | 61 +++++++++ 14 files changed, 994 insertions(+) create mode 100644 offapi/com/sun/star/logging/ConsoleHandler.idl create mode 100644 offapi/com/sun/star/logging/CsvLogFormatter.idl create mode 100644 offapi/com/sun/star/logging/FileHandler.idl create mode 100644 offapi/com/sun/star/logging/LogLevel.idl create mode 100644 offapi/com/sun/star/logging/LogRecord.idl create mode 100644 offapi/com/sun/star/logging/LoggerPool.idl create mode 100644 offapi/com/sun/star/logging/PlainTextFormatter.idl create mode 100644 offapi/com/sun/star/logging/SimpleTextFormatter.idl create mode 100644 offapi/com/sun/star/logging/XConsoleHandler.idl create mode 100644 offapi/com/sun/star/logging/XCsvLogFormatter.idl create mode 100644 offapi/com/sun/star/logging/XLogFormatter.idl create mode 100644 offapi/com/sun/star/logging/XLogHandler.idl create mode 100644 offapi/com/sun/star/logging/XLogger.idl create mode 100644 offapi/com/sun/star/logging/XLoggerPool.idl (limited to 'offapi/com/sun/star/logging') diff --git a/offapi/com/sun/star/logging/ConsoleHandler.idl b/offapi/com/sun/star/logging/ConsoleHandler.idl new file mode 100644 index 000000000..981cac56f --- /dev/null +++ b/offapi/com/sun/star/logging/ConsoleHandler.idl @@ -0,0 +1,68 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_ConsoleHandler_idl__ +#define __com_sun_star_logging_ConsoleHandler_idl__ + +#include +#include + + +module com { module sun { module star { module logging { + +interface XConsoleHandler; + + +/** specifies a component implementing a log handler whose output + channel is the processes console. + + @since OOo 2.3 + */ +service ConsoleHandler : XConsoleHandler +{ + /// creates a ConsoleHandler + create(); + + /** creates an instance of the log handler, using generic settings + + @param Settings + contains the initial settings for the log handler + +

The following settings are recognized and supported: +

  • Encoding - denotes the initial value of the XLogHandler::Encoding
  • +
  • Formatter - denotes the initial value of the XLogHandler::Formatter
  • +
  • Level - denotes the initial value of the XLogHandler::Level
  • +
  • Threshold - denotes the initial value of the XConsoleHandler::Threshold
  • +

+ + @throws ::com::sun::star::lang::IllegalArgumentException + if `Settings` contains arguments with names other than in the list above, or + settings whose value is of the wrong type. + */ + createWithSettings( [in] sequence< ::com::sun::star::beans::NamedValue > Settings ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/CsvLogFormatter.idl b/offapi/com/sun/star/logging/CsvLogFormatter.idl new file mode 100644 index 000000000..5e20170c6 --- /dev/null +++ b/offapi/com/sun/star/logging/CsvLogFormatter.idl @@ -0,0 +1,54 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_CsvLogFormatter_idl__ +#define __com_sun_star_logging_CsvLogFormatter_idl__ + + +module com { module sun { module star { module logging { + +interface XCsvLogFormatter; + + +/** specifies a service which formats log records for RFC4180-style CSV-Files + +

Every log record, as passed to XCsvLogFormatter::format(), + will be formatted into a single row for a CSV file. + The sequence number, the thread ID, the time of the logged event, + the source class/method name will get logged alongside the message, if this + is not disabled. The Formatter also supports logging an arbitrary number of + user-defined columns. If the Formatter is configured to have more than one + (user-defined) column the data to log has to be preformatted with the + formatMultiColumn method.

+ + @since OOo 3.0 + */ +service CsvLogFormatter : XCsvLogFormatter +{ + /// creates a CsvLogFormatter instance + create(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/FileHandler.idl b/offapi/com/sun/star/logging/FileHandler.idl new file mode 100644 index 000000000..3327df304 --- /dev/null +++ b/offapi/com/sun/star/logging/FileHandler.idl @@ -0,0 +1,83 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_FileHandler_idl__ +#define __com_sun_star_logging_FileHandler_idl__ + +#include +#include + + +module com { module sun { module star { module logging { + +interface XLogHandler; + + +/** specifies a component implementing a log handler whose output + channel is a file. + +

The handler will use the Encoding attribute of XLogHandler + to determine how to encode strings before actually writing them to the output + file.

+ + @see XLogHandler::Encoding + + @since OOo 2.3 + */ +service FileHandler : XLogHandler +{ + /** creates a log handler whose output is directed to a file given by URL. + + @param FileURL + the URL of the file to be created. This URL is resolved using the + ::com::sun::star::util::PathSubstitution service. That + is, it is allowed to include placeholders such as $(userurl). + */ + create( [in] string FileURL ); + + /** creates an instance of the log handler, using generic settings + + @param Settings + contains the initial settings for the log handler + +

The following settings are recognized and supported: +

  • Encoding - denotes the initial value of the XLogHandler::Encoding
  • +
  • Formatter - denotes the initial value of the XLogHandler::Formatter
  • +
  • Level - denotes the initial value of the XLogHandler::Level
  • +

+ +

Additionally, a setting name FileURL is recognized. It must be of type + string, and denotes the file URL to which the handler's output should be directed.

+ +

At least the URL argument must be present in the settings.

+ + @throws ::com::sun::star::lang::IllegalArgumentException + if `Settings` contains settings whose value is of the wrong type. + */ + createWithSettings( [in] sequence< ::com::sun::star::beans::NamedValue > Settings ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/LogLevel.idl b/offapi/com/sun/star/logging/LogLevel.idl new file mode 100644 index 000000000..dc3beaaa0 --- /dev/null +++ b/offapi/com/sun/star/logging/LogLevel.idl @@ -0,0 +1,77 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_LogLevel_idl__ +#define __com_sun_star_logging_LogLevel_idl__ + + +module com { module sun { module star { module logging { + + +/** specifies levels to distinguish between severities of logged events + + @see XLogger + + @since OOo 2.3 + */ +constants LogLevel +{ + /** specifies that no messages are to be logged at all + +

This level can be set at an XLogger to completely prevent + logging. You will usually not use it with a concrete log event.

+ */ + const long OFF = 0x7FFFFFFF; + + /// denotes a serious failure to be logged + const long SEVERE = 1000; + + /// denotes a potential problem to be logged + const long WARNING = 900; + + /// denotes an informational message to be logged + const long INFO = 800; + + /// denotes a static configuration message to be logged + const long CONFIG = 700; + + /// denotes basic tracing information to be logged + const long FINE = 500; + + /// denotes more fine-grained tracing information to be logged + const long FINER = 400; + + /// denotes highly detailed tracing information to be logged + const long FINEST = 300; + + /** specifies that all messages should be logged + +

This level can be set at an XLogger to enable logging + of absolutely all events. You will usually not use it with a concrete log event.

+ */ + const long ALL = -0x80000000; +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/LogRecord.idl b/offapi/com/sun/star/logging/LogRecord.idl new file mode 100644 index 000000000..d0ae88e1b --- /dev/null +++ b/offapi/com/sun/star/logging/LogRecord.idl @@ -0,0 +1,84 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_LogRecord_idl__ +#define __com_sun_star_logging_LogRecord_idl__ + +#include + + +module com { module sun { module star { module logging { + + +/** assembles the complete information about a to-be-logged event + + @see XLogger + + @since OOo 2.3 + */ +struct LogRecord +{ + /// specifies the name of the logger at which the record is logged + string LoggerName; + + /** specifies the name of the class, in which the record was logged. + + This name might be empty, in case the caller to one of the various + log methods of XLogger did not specify it. + */ + string SourceClassName; + + /** specifies the name of the method, in which the record was logged. + + This name might be empty, in case the caller to one of the various + log methods of XLogger did not specify it. + */ + string SourceMethodName; + + /// specifies the to-be-logged message + string Message; + + /// specifies the time at which the event was logged + ::com::sun::star::util::DateTime + LogTime; + + /** specifies the number of the log event. + + Subsequent events get assigned increasing sequence numbers by the XLogger + at which they're logged. + */ + hyper SequenceNumber; + + /// specifies the ID of the thread in which the event was logged + string ThreadID; + + /** specifies the level of the log event + + @see LogLevel + */ + long Level; +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/LoggerPool.idl b/offapi/com/sun/star/logging/LoggerPool.idl new file mode 100644 index 000000000..cc9b5da8f --- /dev/null +++ b/offapi/com/sun/star/logging/LoggerPool.idl @@ -0,0 +1,43 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_LoggerPool_idl__ +#define __com_sun_star_logging_LoggerPool_idl__ + +#include + + +module com { module sun { module star { module logging { + +/** the global pool of named XLogger instances + +

The one and only LoggerPool instance is available at a component context as value with the key + /singletons/com.sun.star.logging.LoggerPool.

+ + @since OOo 2.3 +*/ +singleton LoggerPool : XLoggerPool; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/PlainTextFormatter.idl b/offapi/com/sun/star/logging/PlainTextFormatter.idl new file mode 100644 index 000000000..16868d25e --- /dev/null +++ b/offapi/com/sun/star/logging/PlainTextFormatter.idl @@ -0,0 +1,50 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_PlainTextFormatter_idl__ +#define __com_sun_star_logging_PlainTextFormatter_idl__ + + +module com { module sun { module star { module logging { + +interface XLogFormatter; + + +/** specifies a service which formats log records as single line plain text + +

Every log record, as passed to XLogFormatter::format(), will + be formatted into a single text line, assembling the sequence number, the thread ID, + the time of the logged event, the source class/method name (if applicable), and the + log message.

+ + @since OOo 2.3 + */ +service PlainTextFormatter : XLogFormatter +{ + /// creates a PlainTextFormatter instance + create(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/SimpleTextFormatter.idl b/offapi/com/sun/star/logging/SimpleTextFormatter.idl new file mode 100644 index 000000000..03aae22ef --- /dev/null +++ b/offapi/com/sun/star/logging/SimpleTextFormatter.idl @@ -0,0 +1,49 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_SimpleTextFormatter_idl__ +#define __com_sun_star_logging_SimpleTextFormatter_idl__ + + +module com { module sun { module star { module logging { + +interface XLogFormatter; + + +/** specifies a service which formats log records as single line plain text + +

Every log record, as passed to XLogFormatter::format(), will + be formatted into a single text line, with just the log message being output. + If the loglevel is WARNING, or SEVERE, the line will be prefixed accordingly.

+ + @since LibreOffice 6.2 + */ +service SimpleTextFormatter : XLogFormatter +{ + /// creates a SimpleTextFormatter instance + create(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XConsoleHandler.idl b/offapi/com/sun/star/logging/XConsoleHandler.idl new file mode 100644 index 000000000..5d6ff6cba --- /dev/null +++ b/offapi/com/sun/star/logging/XConsoleHandler.idl @@ -0,0 +1,55 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_XConsoleHandler_idl__ +#define __com_sun_star_logging_XConsoleHandler_idl__ + +#include + + +module com { module sun { module star { module logging { + + +/** implemented by a log handler whose output channel is the processes console. + +

Note that a console handler will ignore its formatter's head and tail, since + it cannot decided whether they should be emitted on stdout or stderr.

+ + @since OOo 2.3 + */ +interface XConsoleHandler : XLogHandler +{ + /** denotes the LogLevel threshold used to determine to which + console the events should be logged. + +

Events with a level greater or equal to Threshold will be + logged to stderr, all others to stdout.

+ +

The default value for this attribute is LogLevel::SEVERE.

+ */ + [attribute] long Threshold; +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XCsvLogFormatter.idl b/offapi/com/sun/star/logging/XCsvLogFormatter.idl new file mode 100644 index 000000000..038f8c478 --- /dev/null +++ b/offapi/com/sun/star/logging/XCsvLogFormatter.idl @@ -0,0 +1,69 @@ +/* -*- 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 . + */ + + +#ifndef __com_sun_star_logging_XCsvLogFormatter_idl__ +#define __com_sun_star_logging_XCsvLogFormatter_idl__ + +#include +#include + + +module com { module sun { module star { module logging { + + +/** specifies the interface used for formatting log records for RFC4180 CSV + output + + @see XLogFormatter, XLogHandler + + @since OOo 3.0 +*/ +interface XCsvLogFormatter : XLogFormatter +{ + /** Defines if the EventNo should be logged */ + [attribute] boolean LogEventNo; + /** Defines if the ThreadId should be logged */ + [attribute] boolean LogThread; + /** Defines if the Timestamp should be logged */ + [attribute] boolean LogTimestamp; + /** Defines if the Source should be logged */ + [attribute] boolean LogSource; + /** Defines the names of the additional columns + this defaults to only one row titled "message". + if this is set to more than one column, the + messages need to be preformatted using + formatMultiColumn*/ + [attribute] sequence< string > Columnnames; + /** if the CsvLogFormatter is set to have more than one + column, any logged information has to be send through this + method before calling log(). E.g.: + + XLoggerInstance.log(1000, XCsvLogFormatterInstance.formatMultiColumn(columnData)) + */ + string formatMultiColumn( [in] sequence< string > columnData); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XLogFormatter.idl b/offapi/com/sun/star/logging/XLogFormatter.idl new file mode 100644 index 000000000..1bc474caa --- /dev/null +++ b/offapi/com/sun/star/logging/XLogFormatter.idl @@ -0,0 +1,73 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_XLogFormatter_idl__ +#define __com_sun_star_logging_XLogFormatter_idl__ + +#include +#include + + +module com { module sun { module star { module logging { + + +/** specifies the interface to be used for formatting log records + + @see XLogHandler + + @since OOo 2.3 +*/ +interface XLogFormatter +{ + /** returns the header string for the log + +

This can be used to generate a header string, which by the XLogHandler + is emitted to its output channel before actually logging any concrete + LogRecord.

+ +

For instance, a formatter might produce table-like plain text output, + and could return a table-head string (potentially including line breaks) + here.

+ */ + string getHead(); + + /** formats the given log record for output + +

A XLogHandler will call this method to format a given + log record. The resulting string will be emitted to the handler's output + channel, without processing it any further (except possibly encoding it with + the handler's Encoding).

+ */ + string format( [in] LogRecord Record ); + + /** returns the footer string for the log + +

This can be used to generate a footer string, which by the XLogHandler + is emitted to its output channel before it is finally being closed.

+ */ + string getTail(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XLogHandler.idl b/offapi/com/sun/star/logging/XLogHandler.idl new file mode 100644 index 000000000..cdb770c3b --- /dev/null +++ b/offapi/com/sun/star/logging/XLogHandler.idl @@ -0,0 +1,92 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_XLogHandler_idl__ +#define __com_sun_star_logging_XLogHandler_idl__ + +#include +#include +#include + + +module com { module sun { module star { module logging { + + +/** provides possibilities to send LogRecords to an arbitrary output + channel. + + @see XLogger + + @since OOo 2.3 + */ +interface XLogHandler +{ + /** allows life time control for the handler + +

Disposing the handler effectively means closing the channel + to which the handler forwards the log records. + */ + interface ::com::sun::star::lang::XComponent; + + /** specifies MIME charset name for the encoding to be used by this handler + +

It depends on the concrete handler implementation whether or not this + parameter is needed.

+ + @see http://www.iana.org/assignments/character-sets + */ + [attribute] string Encoding; + + /** specifies the formatter to be used by this handler. + */ + [attribute] XLogFormatter Formatter; + + /** specifies the log level of this handler + +

Different handlers can have different log levels, which again might be + different from the log level of the XLogger for which the handlers + are used.

+ */ + [attribute] long Level; + + /** flushes all buffered output of the handler + +

Log handlers are allowed to buffer their output. Upon flush + being called, they must flush all their buffers.

+ */ + void flush(); + + /** publish the given log record at the handler's output channel. + + @return + `TRUE` if and only if the record was actually published. A handler + will not publish a record if its log level doesn't meet the handler's + log level, if the record is filtered, or if any other handler-specified + restrictions apply. + */ + boolean publish( [in] LogRecord Record ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XLogger.idl b/offapi/com/sun/star/logging/XLogger.idl new file mode 100644 index 000000000..5ee092287 --- /dev/null +++ b/offapi/com/sun/star/logging/XLogger.idl @@ -0,0 +1,136 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_XLogger_idl__ +#define __com_sun_star_logging_XLogger_idl__ + +#include + + +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: +

  • There's no support (yet) for filtering log events.
  • +
  • There ain't no convenience methods for logging.
  • +
  • There's no localization support.
  • +
  • Logger instances do not form a hierarchy.
  • +

+ + @since OOo 2.3 + */ +interface XLogger +{ + /** denotes the name of the logger. + */ + [attribute, readonly] string Name; + + /** specifies which log events are logged or ignored. + + @see LogLevel + */ + [attribute] long Level; + + /** adds the given handler to the list of handlers. + +

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.

+ + @param Level + level to be checked against + + @returns + `TRUE` if there would be some output for this XLogger for the given level, `FALSE` + otherwise. Note that a return value of `FALSE` could also indicate that the logger + does not have any log handlers associated with it. + + @see addLogHandler + @see removeLogHandler + */ + boolean isLoggable( [in] long Level ); + + /** logs a given message + + @param Level + the log level of this message. If this level is smaller than the logger's #Level + attribute, then the call will be ignored. + + @param Message + the message to log + */ + void log( [in] long Level, [in] string Message ); + + /** logs a given message, detailing the source class and method at which the logged + event occurred. + + @param Level + the log level of this message. If this level is smaller than the logger's #Level + attribute, then the call will be ignored. + + @param SourceClass + the source class at which the logged event occurred. + + @param SourceMethod + the source class at which the logged event occurred. + + @param Message + the message to log + */ + void logp( [in] long Level, [in] string SourceClass, [in] string SourceMethod, [in] string Message ); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/logging/XLoggerPool.idl b/offapi/com/sun/star/logging/XLoggerPool.idl new file mode 100644 index 000000000..fa995847d --- /dev/null +++ b/offapi/com/sun/star/logging/XLoggerPool.idl @@ -0,0 +1,61 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_logging_XLoggerPool_idl__ +#define __com_sun_star_logging_XLoggerPool_idl__ + +#include + + +module com { module sun { module star { module logging { + +interface XLogger; + + +/** implements a pool for named XLogger instances + + @since OOo 2.3 + */ +interface XLoggerPool +{ + /** retrieves a logger with the given name + +

Multiple attempts to retrieve a logger with the same name will return + the same instance.

+ +

Newly created logger instances are initialized via configuration. See the configuration + module /org.openoffice.Office.Logging for an explanation of the initialization + pattern.

+ */ + XLogger getNamedLogger( [in] string Name ); + + /** retrieves a logger with the default name "org.openoffice.logging.DefaultLogger". + +

Calling this method is equivalent to calling getNamedLogger( "org.openoffice.logging.DefaultLogger" ).

+ */ + XLogger getDefaultLogger(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3