diff options
Diffstat (limited to '')
-rw-r--r-- | offapi/com/sun/star/logging/ConsoleHandler.idl | 68 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/CsvLogFormatter.idl | 54 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/FileHandler.idl | 83 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LogLevel.idl | 77 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LogRecord.idl | 84 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LoggerPool.idl | 43 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/PlainTextFormatter.idl | 50 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/SimpleTextFormatter.idl | 49 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XConsoleHandler.idl | 55 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XCsvLogFormatter.idl | 69 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogFormatter.idl | 73 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogHandler.idl | 92 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogger.idl | 136 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLoggerPool.idl | 61 |
14 files changed, 994 insertions, 0 deletions
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 <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/beans/NamedValue.idl> + + +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 <code>ConsoleHandler</code> + create(); + + /** creates an instance of the log handler, using generic settings + + @param Settings + contains the initial settings for the log handler + + <p>The following settings are recognized and supported: + <ul><li><code>Encoding</code> - denotes the initial value of the XLogHandler::Encoding</li> + <li><code>Formatter</code> - denotes the initial value of the XLogHandler::Formatter</li> + <li><code>Level</code> - denotes the initial value of the XLogHandler::Level</li> + <li><code>Threshold</code> - denotes the initial value of the XConsoleHandler::Threshold</li> + </ul></p> + + @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 + + <p>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.</p> + + @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 <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/beans/NamedValue.idl> + + +module com { module sun { module star { module logging { + +interface XLogHandler; + + +/** specifies a component implementing a log handler whose output + channel is a file. + + <p>The handler will use the <code>Encoding</code> attribute of XLogHandler + to determine how to encode strings before actually writing them to the output + file.</p> + + @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 <code>$(userurl)</code>. + */ + create( [in] string FileURL ); + + /** creates an instance of the log handler, using generic settings + + @param Settings + contains the initial settings for the log handler + + <p>The following settings are recognized and supported: + <ul><li><code>Encoding</code> - denotes the initial value of the XLogHandler::Encoding</li> + <li><code>Formatter</code> - denotes the initial value of the XLogHandler::Formatter</li> + <li><code>Level</code> - denotes the initial value of the XLogHandler::Level</li> + </ul></p> + + <p>Additionally, a setting name <code>FileURL</code> is recognized. It must be of type + string, and denotes the file URL to which the handler's output should be directed.</p> + + <p>At least the URL argument must be present in the settings.</p> + + @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 + + <p>This level can be set at an XLogger to completely prevent + logging. You will usually not use it with a concrete log event.</p> + */ + 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 + + <p>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.</p> + */ + 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 <com/sun/star/util/DateTime.idl> + + +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 + <code>log</code> 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 + <code>log</code> 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 <com/sun/star/logging/XLoggerPool.idl> + + +module com { module sun { module star { module logging { + +/** the global pool of named XLogger instances + + <p>The one and only <code>LoggerPool</code> instance is available at a component context as value with the key + <code>/singletons/com.sun.star.logging.LoggerPool</code>.</p> + + @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 + + <p>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.</p> + + @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 + + <p>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.</p> + + @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 <com/sun/star/logging/XLogHandler.idl> + + +module com { module sun { module star { module logging { + + +/** implemented by a log handler whose output channel is the processes console. + + <p>Note that a console handler will ignore its formatter's head and tail, since + it cannot decided whether they should be emitted on <code>stdout</code> or <code>stderr</code>.</p> + + @since OOo 2.3 + */ +interface XConsoleHandler : XLogHandler +{ + /** denotes the LogLevel threshold used to determine to which + console the events should be logged. + + <p>Events with a level greater or equal to <code>Threshold</code> will be + logged to <code>stderr</code>, all others to <code>stdout</code>.</p> + + <p>The default value for this attribute is LogLevel::SEVERE.</p> + */ + [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 <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/logging/XLogFormatter.idl> + + +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 + <code>formatMultiColumn</code>*/ + [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.: + + <code>XLoggerInstance.log(1000, XCsvLogFormatterInstance.formatMultiColumn(columnData))</code> + */ + 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 <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/logging/LogRecord.idl> + + +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 + + <p>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.</p> + + <p>For instance, a formatter might produce table-like plain text output, + and could return a table-head string (potentially including line breaks) + here.</p> + */ + string getHead(); + + /** formats the given log record for output + + <p>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 <code>Encoding</code>).</p> + */ + string format( [in] LogRecord Record ); + + /** returns the footer string for the log + + <p>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.</p> + */ + 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 <com/sun/star/lang/XComponent.idl> +#include <com/sun/star/logging/LogRecord.idl> +#include <com/sun/star/logging/XLogFormatter.idl> + + +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 + + <p>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 + + <p>It depends on the concrete handler implementation whether or not this + parameter is needed.<p> + + @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 + + <p>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.</p> + */ + [attribute] long Level; + + /** flushes all buffered output of the handler + + <p>Log handlers are allowed to buffer their output. Upon <code>flush</code> + being called, they must flush all their buffers.</p> + */ + 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 <com/sun/star/uno/XInterface.idl> + + +module com { module sun { module star { module logging { + +interface XLogHandler; + + +/** implemented by a component which is able to log events. + + <p>This interface is roughly designed after the + <a href="http://java.sun.com/javase/6/docs/api/java/util/logging/package-summary.html">Java + Logging API</a>. However, there are some differences, the major ones being: + <ul><li>There's no support (yet) for filtering log events.</li> + <li>There ain't no convenience methods for logging.</li> + <li>There's no localization support.</li> + <li>Logger instances do not form a hierarchy.</li> + </ul></p> + + @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. + + <p>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.</p> + + <p>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.</p> + + @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. + + <p>The method can be used to optimize performance as maybe complex parameter evaluation + in the <code>log</code> calls can be omitted if <code>isLoggable</code> evaluates to false.</p> + + @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 <com/sun/star/uno/XInterface.idl> + + +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 + + <p>Multiple attempts to retrieve a logger with the same name will return + the same instance.</p> + + <p>Newly created logger instances are initialized via configuration. See the configuration + module <code>/org.openoffice.Office.Logging</code> for an explanation of the initialization + pattern.</p> + */ + XLogger getNamedLogger( [in] string Name ); + + /** retrieves a logger with the default name "org.openoffice.logging.DefaultLogger". + + <p>Calling this method is equivalent to calling <code>getNamedLogger( "org.openoffice.logging.DefaultLogger" )</code>.</p> + */ + XLogger getDefaultLogger(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |