diff options
Diffstat (limited to 'offapi/com/sun/star/logging')
-rw-r--r-- | offapi/com/sun/star/logging/ConsoleHandler.idl | 82 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/CsvLogFormatter.idl | 63 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/DocumentIOLogRing.idl | 63 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/FileHandler.idl | 97 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LogLevel.idl | 87 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LogRecord.idl | 96 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/LoggerPool.idl | 34 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/PlainTextFormatter.idl | 60 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/SimpleLogRing.idl | 69 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XConsoleHandler.idl | 67 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XCsvLogFormatter.idl | 83 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogFormatter.idl | 88 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogHandler.idl | 110 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLogger.idl | 148 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XLoggerPool.idl | 73 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/XSimpleLogRing.idl | 74 | ||||
-rw-r--r-- | offapi/com/sun/star/logging/makefile.mk | 55 |
17 files changed, 1349 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 000000000000..92bd6fdc7e28 --- /dev/null +++ b/offapi/com/sun/star/logging/ConsoleHandler.idl @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_ConsoleHandler_idl__ +#define __com_sun_star_logging_ConsoleHandler_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================= + +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 <member>XLogHandler::Encoding</member></li> + <li><code>Formatter</code> - denotes the initial value of the <member>XLogHandler::Formatter</member></li> + <li><code>Level</code> - denotes the initial value of the <member>XLogHandler::Level</member></li> + <li><code>Threshold</code> - denotes the initial value of the <member>XConsoleHandler::Threshold</member></li> + </ul></p> + + @throws ::com::sun::star::lang::IllegalArgumentException + if <arg>Settings</args> 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 diff --git a/offapi/com/sun/star/logging/CsvLogFormatter.idl b/offapi/com/sun/star/logging/CsvLogFormatter.idl new file mode 100644 index 000000000000..4db61b9be9d9 --- /dev/null +++ b/offapi/com/sun/star/logging/CsvLogFormatter.idl @@ -0,0 +1,63 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +#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 <member>XCsvLogFormatter::format</member>, + 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 + userdefined columns. If the Formatter is configured to have more than one + (userdefined) 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 diff --git a/offapi/com/sun/star/logging/DocumentIOLogRing.idl b/offapi/com/sun/star/logging/DocumentIOLogRing.idl new file mode 100644 index 000000000000..59593e2b3285 --- /dev/null +++ b/offapi/com/sun/star/logging/DocumentIOLogRing.idl @@ -0,0 +1,63 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_DocumentIOLogRing_idl__ +#define __com_sun_star_logging_DocumentIOLogRing_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +interface XSimpleLogRing; + +//============================================================================= + +/** This singleton is intended to log the IO events related to loading/storing + of documents. + + <p> + Please do not use the singleton without communication with source owner! + </p> + + @since OOo 3.2 + */ +singleton DocumentIOLogRing : XSimpleLogRing; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/FileHandler.idl b/offapi/com/sun/star/logging/FileHandler.idl new file mode 100644 index 000000000000..b20a50618a56 --- /dev/null +++ b/offapi/com/sun/star/logging/FileHandler.idl @@ -0,0 +1,97 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_FileHandler_idl__ +#define __com_sun_star_logging_FileHandler_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================= + +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 <type>XLogHandler</type> + 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 + <type scope="::com::sun::star::util">PathSubstitution</type> 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 <member>XLogHandler::Encoding</member></li> + <li><code>Formatter</code> - denotes the initial value of the <member>XLogHandler::Formatter</member></li> + <li><code>Level</code> - denotes the initial value of the <member>XLogHandler::Level</member></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 <arg>Settings</args> 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 diff --git a/offapi/com/sun/star/logging/LogLevel.idl b/offapi/com/sun/star/logging/LogLevel.idl new file mode 100644 index 000000000000..7a5f96470aa9 --- /dev/null +++ b/offapi/com/sun/star/logging/LogLevel.idl @@ -0,0 +1,87 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <type>XLogger</type> 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 <type>XLogger</type> to enable logging + of absolutely all events. You will usually not use it with a concrete log event.</p> + */ + const long ALL = -0x80000000; +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/LogRecord.idl b/offapi/com/sun/star/logging/LogRecord.idl new file mode 100644 index 000000000000..9d35f351de04 --- /dev/null +++ b/offapi/com/sun/star/logging/LogRecord.idl @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_LogRecord_idl__ +#define __com_sun_star_logging_LogRecord_idl__ + +#ifndef __com_sun_star_util_DateTime_idl__ +#include <com/sun/star/util/DateTime.idl> +#endif + +//============================================================================= + +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 <type>XLogger</type> 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 <type>XLogger</type> 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 <type>XLogger</type> + 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 diff --git a/offapi/com/sun/star/logging/LoggerPool.idl b/offapi/com/sun/star/logging/LoggerPool.idl new file mode 100644 index 000000000000..5372e09c088d --- /dev/null +++ b/offapi/com/sun/star/logging/LoggerPool.idl @@ -0,0 +1,34 @@ +#ifndef __com_sun_star_logging_LoggerPool_idl__ +#define __com_sun_star_logging_LoggerPool_idl__ + +#ifndef __com_sun_star_logging_XLoggerPool_idl__ +#include <com/sun/star/logging/XLoggerPool.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +//============================================================================= + +/** the global pool of named <type>XLogger</type> 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> +*/ +/** the global pool of named <type>XLogger</type> 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 diff --git a/offapi/com/sun/star/logging/PlainTextFormatter.idl b/offapi/com/sun/star/logging/PlainTextFormatter.idl new file mode 100644 index 000000000000..a8580ed5400a --- /dev/null +++ b/offapi/com/sun/star/logging/PlainTextFormatter.idl @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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 <member>XLogFormatter::format</member>, 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 diff --git a/offapi/com/sun/star/logging/SimpleLogRing.idl b/offapi/com/sun/star/logging/SimpleLogRing.idl new file mode 100644 index 000000000000..fe3083724c26 --- /dev/null +++ b/offapi/com/sun/star/logging/SimpleLogRing.idl @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_SimpleLogRing_idl__ +#define __com_sun_star_logging_SimpleLogRing_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +interface XSimpleLogRing; + +//============================================================================= + +/** This service allows to log the events in a ring of specified size. + + @since OOo 3.2 + */ +service SimpleLogRing : XSimpleLogRing +{ + /** creates a ring of default size - 256 messages + */ + create(); + + /** creates a ring of specified size + @param nSize + the number of messages in a ring + */ + createWithSize( [in] long nSize ); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/XConsoleHandler.idl b/offapi/com/sun/star/logging/XConsoleHandler.idl new file mode 100644 index 000000000000..a8d634c78f05 --- /dev/null +++ b/offapi/com/sun/star/logging/XConsoleHandler.idl @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __offapi_com_sun_star_logging_XConsoleHandler_idl__ +#define __offapi_com_sun_star_logging_XConsoleHandler_idl__ + +#ifndef __com_sun_star_logging_XLogHandler_idl__ +#include <com/sun/star/logging/XLogHandler.idl> +#endif + +//============================================================================= + +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 +{ + /** renotes the <type>LogLevel</type> 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 <member>LogLevel::SEVERE</member>.</p> + */ + [attribute] long Threshold; +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/XCsvLogFormatter.idl b/offapi/com/sun/star/logging/XCsvLogFormatter.idl new file mode 100644 index 000000000000..ca054060be87 --- /dev/null +++ b/offapi/com/sun/star/logging/XCsvLogFormatter.idl @@ -0,0 +1,83 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * +************************************************************************/ + + +#ifndef __com_sun_star_logging_XCsvLogFormatter_idl__ +#define __com_sun_star_logging_XCsvLogFormatter_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_logging_XLogFormatter_idl__ +#include <com/sun/star/logging/XLogFormatter.idl> +#endif + +//============================================================================= + +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 infomation has to be send through this + method before calling log(). E.g.: + + <code>XLoggerInstance.log(1000, XCsvLogFormatterInstance.formatMultiColumn(column_data))</code> + */ + string formatMultiColumn( [in] sequence< string > column_data); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/XLogFormatter.idl b/offapi/com/sun/star/logging/XLogFormatter.idl new file mode 100644 index 000000000000..4a0e5c68b6ef --- /dev/null +++ b/offapi/com/sun/star/logging/XLogFormatter.idl @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_XLogFormatter_idl__ +#define __com_sun_star_logging_XLogFormatter_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_logging_LogRecord_idl__ +#include <com/sun/star/logging/LogRecord.idl> +#endif + +//============================================================================= + +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 <type>XLogHandler</type> + is emitted to its output channel before actually logging any concrete + <type>LogRecord</type>.</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 <type>XLogHandler</type> 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 <type>XLogHandler</type> + is emitted to its output channel before it is finally being closed.</p> + */ + string getTail(); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/XLogHandler.idl b/offapi/com/sun/star/logging/XLogHandler.idl new file mode 100644 index 000000000000..6bf52bd9f2cd --- /dev/null +++ b/offapi/com/sun/star/logging/XLogHandler.idl @@ -0,0 +1,110 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_XLogHandler_idl__ +#define __com_sun_star_logging_XLogHandler_idl__ + +#ifndef __com_sun_star_lang_XComponent_idl__ +#include <com/sun/star/lang/XComponent.idl> +#endif + +#ifndef __com_sun_star_logging_LogRecord_idl__ +#include <com/sun/star/logging/LogRecord.idl> +#endif + +#ifndef __com_sun_star_logging_XLogFormatter_idl__ +#include <com/sun/star/logging/XLogFormatter.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +//============================================================================= + +/** provides possibilites to send <type>LogRecord</type>s 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 <type>XLogger</type> 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 diff --git a/offapi/com/sun/star/logging/XLogger.idl b/offapi/com/sun/star/logging/XLogger.idl new file mode 100644 index 000000000000..74998458af88 --- /dev/null +++ b/offapi/com/sun/star/logging/XLogger.idl @@ -0,0 +1,148 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_XLogger_idl__ +#define __com_sun_star_logging_XLogger_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= + +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 menthods 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 <type>LogRecord</type> + 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 (<member>XLogHandler::Level</member>) 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 beed 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 <member>Level</member> + 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 occured. + + @param Level + the log level of this message. If this level is smaller than the logger's <member>Level</member> + attribute, then the call will be ignored. + + @param SourceClass + the source class at which the logged event occured. + + @param SourceMethod + the source class at which the logged event occured. + + @param Message + the message to log + */ + void logp( [in] long Level, [in] string SourceClassName, [in] string SourceMethodName, [in] string Message ); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/XLoggerPool.idl b/offapi/com/sun/star/logging/XLoggerPool.idl new file mode 100644 index 000000000000..e7c1017dc8a4 --- /dev/null +++ b/offapi/com/sun/star/logging/XLoggerPool.idl @@ -0,0 +1,73 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_XLoggerPool_idl__ +#define __com_sun_star_logging_XLoggerPool_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +interface XLogger; + +//============================================================================= + +/** implements a pool for named <type>XLogger</type> 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 diff --git a/offapi/com/sun/star/logging/XSimpleLogRing.idl b/offapi/com/sun/star/logging/XSimpleLogRing.idl new file mode 100644 index 000000000000..a0a8d1f0483c --- /dev/null +++ b/offapi/com/sun/star/logging/XSimpleLogRing.idl @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_logging_XSimpleLogRing_idl__ +#define __com_sun_star_logging_XSimpleLogRing_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module logging { + +//============================================================================= + +/** a simple log ring allowing to collect a limited number of last events + + <p> + The intention of this interface is to provide a simple possibility + for developer to collect the most important events without affecting + the performance. For this reasons the messages related API is quite + simple, the strings should be produced by the preprocessor mainly. + </p> + + @since OOo 3.2 + */ +interface XSimpleLogRing +{ + /** allows to add a message to the logger + */ + void logString( [in] string aMessage ); + + /** allows to get the collected messages from the logger + + <p> + It is up to logger implementation to provide only the limited + number of last messages. + </p> + */ + sequence< string > getCollectedLog(); +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/logging/makefile.mk b/offapi/com/sun/star/logging/makefile.mk new file mode 100644 index 000000000000..9a5e82845443 --- /dev/null +++ b/offapi/com/sun/star/logging/makefile.mk @@ -0,0 +1,55 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ := ..$/..$/..$/.. +PRJNAME := offapi +TARGET := csslogging + +PACKAGE := com$/sun$/star$/logging + +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +IDLFILES = \ + ConsoleHandler.idl\ + CsvLogFormatter.idl\ + DocumentIOLogRing.idl\ + FileHandler.idl\ + LoggerPool.idl\ + LogLevel.idl\ + LogRecord.idl\ + PlainTextFormatter.idl\ + SimpleLogRing.idl\ + XConsoleHandler.idl\ + XCsvLogFormatter.idl\ + XLogFormatter.idl\ + XLogger.idl\ + XLoggerPool.idl\ + XLogHandler.idl\ + XSimpleLogRing.idl + +.INCLUDE: target.mk +.INCLUDE: $(PRJ)$/util$/target.pmk |