|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--TwilightMinds.Log.LogManager
The LogManager class keeps track of any aribitrary Log objects and
allows easily formatted and synchronized recording of LogEntry objects of
various EntryTypes to any of the Logs. All objects of a given EntryType
are sent to a single Log of choice.
The LogManager class can also enable and disable logging for individual
Logs or EntryTypes.
Use the static LogManager methods to set up your Logs and EntryTypes
when your application initializes, and then you can use the static
writeEntry() methods throughout your application.
Author: Reason
Last Modified: 11/23/00
------------------------------------------------
Copyright (C) 2000 Twilight Minds. All rights reserved.
This Java package is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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 for more details.
You should have received a copy of the GNU Lesser General Public
License along with this package; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
Alternatively, a copy can be obtained from the Twilight Minds web
site:
http://www.twilightminds.com/GNU-LGPL.html
Twilight Minds Design Group
http://www.twilightminds.com/
Method Summary | |
static void |
addLog(Log log)
Add a new Log to those managed by the LogManager. |
static void |
addLogAndEntryTypes(Log log,
java.lang.String[] entrytypenames)
Add a new Log to those managed by the LogManager. |
static java.lang.String[] |
getEntryTypeNames()
Return an array of all EntryType names currently used in the LogManager. |
static Log |
getLog(java.lang.String logname)
Return the Log with this name, or null if no such Log exists. |
static java.lang.String[] |
getLogNames()
Return an array of the Log names currently in use in the LogManager. |
static Log[] |
getLogs()
Return an array of the Logs currently in use in the LogManager. |
static void |
removeEntryType(java.lang.String entrytypename)
Remove the EntryType with this name. |
static java.lang.String[] |
removeLog(Log log)
Remove this Log from those managed by the LogManager. |
static java.lang.String |
sentToLog(java.lang.String entrytypename)
Return the name of the Log that LogEntries of this EntryType are sent to. |
static void |
setEntryType(java.lang.String entrytypename,
java.lang.String logname)
Add an EntryType that writes to the Log with the given logname. |
static void |
setEntryType(java.lang.String entrytypename,
java.lang.String logname,
boolean islogging)
Add an EntryType that writes to the Log with the given logname. |
static void |
startAllEntryTypesLogging()
Set LogEntries of all EntryTypes to be logged. |
static void |
startAllLogs()
Start all Logs accepting and recording log entries. |
static void |
startEntryTypeLogging(java.lang.String entrytypename)
Stop LogEntries with this EntryType from being logged. |
static void |
startLog(java.lang.String logname)
Start this Log accepting LogEntries. |
static void |
stopAllEntryTypesLogging()
Stop LogEntries of all EntryTypes from being logged. |
static void |
stopAllLogs()
Stop all Logs from accepting log entries. |
static void |
stopEntryTypeLogging(java.lang.String entrytypename)
Stop logging LogEntries of this EntryType. |
static void |
stopLog(java.lang.String logname)
Stop this Log from accepting LogEntries. |
static boolean |
writeEntry(java.lang.String entrytypename,
java.lang.String entry)
Write an event string as a given EntryType. |
static boolean |
writeEntry(java.lang.String entrytypename,
java.lang.String entry,
java.lang.Exception exception)
Write an event string and exception as a given EntryType. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void addLog(Log log) throws LogException
public static void addLogAndEntryTypes(Log log, java.lang.String[] entrytypenames) throws LogException
public static java.lang.String[] removeLog(Log log)
public static java.lang.String[] getLogNames()
public static Log[] getLogs()
public static Log getLog(java.lang.String logname)
public static void setEntryType(java.lang.String entrytypename, java.lang.String logname) throws LogException
public static void setEntryType(java.lang.String entrytypename, java.lang.String logname, boolean islogging) throws LogException
public static void removeEntryType(java.lang.String entrytypename)
public static java.lang.String[] getEntryTypeNames()
public static java.lang.String sentToLog(java.lang.String entrytypename) throws LogException
public static void startAllEntryTypesLogging()
public static void stopAllEntryTypesLogging()
public static void startEntryTypeLogging(java.lang.String entrytypename) throws LogException
public static void stopEntryTypeLogging(java.lang.String entrytypename) throws LogException
public static void startAllLogs()
public static void stopAllLogs()
public static void startLog(java.lang.String logname) throws LogException
public static void stopLog(java.lang.String logname) throws LogException
public static boolean writeEntry(java.lang.String entrytypename, java.lang.String entry, java.lang.Exception exception)
public static boolean writeEntry(java.lang.String entrytypename, java.lang.String entry)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |