cz.cuni.amis.pogamut.base.utils.logging
Interface ILogCategories

All Known Implementing Classes:
AbstractLogCategories, JMXLogCategories, LogCategories, LogCategoriesJMXProxy

public interface ILogCategories


Method Summary
 void addLogCategory(java.lang.String name, LogCategory category)
          Adds log category from outside of the object.
 java.util.Map<java.lang.String,LogCategory> getCategories()
          Returns IMMUTABLE mapping of categories names to instances of those log categories.
 LogCategory getCategory(java.lang.String name)
          Returns existing category by the name or adds new one.
 java.lang.String[] getCategoryNames()
          Returns names of all existing log categories.
 java.lang.String[] getCategoryNamesSorted()
          Returns names of all existing log categories sorted alphabetically.
 boolean hasCategory(java.lang.String name)
          Whether some category with specified name exists.
 void setLevel(java.util.logging.Level newLevel)
          Set level for all handlers of all categories.
 

Method Detail

hasCategory

boolean hasCategory(java.lang.String name)
Whether some category with specified name exists.

Parameters:
name -
Returns:

getCategories

java.util.Map<java.lang.String,LogCategory> getCategories()
Returns IMMUTABLE mapping of categories names to instances of those log categories.

It does not contain instance of IAgentLogger.

Returns:

addLogCategory

void addLogCategory(java.lang.String name,
                    LogCategory category)
Adds log category from outside of the object.

Parameters:
name -
category -

getCategoryNames

java.lang.String[] getCategoryNames()
Returns names of all existing log categories.

Returns:

getCategoryNamesSorted

java.lang.String[] getCategoryNamesSorted()
Returns names of all existing log categories sorted alphabetically.

Returns:

getCategory

LogCategory getCategory(java.lang.String name)
Returns existing category by the name or adds new one.

Note that new category doesn't have any handler appended, you have to create at least one for the category to produce something.

Example:

LogCategory myCategory = categories.getCategory("my log"); // create new category
myCategory.newHandler(new LogPublisher.ConsolePublisher()); // add new handler with output to the console

Parameters:
name -
Returns:

setLevel

void setLevel(java.util.logging.Level newLevel)
Set level for all handlers of all categories.

Parameters:
newLevel -