cz.cuni.amis.pogamut.base.utils.logging
Class LogCategories
java.lang.Object
cz.cuni.amis.pogamut.base.utils.logging.AbstractLogCategories
cz.cuni.amis.pogamut.base.utils.logging.LogCategories
- All Implemented Interfaces:
- ILogCategories
public class LogCategories
- extends AbstractLogCategories
Class that wraps the map with log categories. It allows you
to simply create new categories or query it's mapping.
The only constructor LogCategories(Logger) is protected and is instantiated
during the construction of AgentLogger
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogCategories
@Inject
public LogCategories()
getCategory
public 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"); // creates new category
myCategory.newHandler(new LogPublisher.ConsolePublisher()); // adds new handler with output to the console
- Parameters:
name
-
- Returns:
getCategoriesInternal
protected java.util.Map<java.lang.String,LogCategory> getCategoriesInternal()
- Specified by:
getCategoriesInternal
in class AbstractLogCategories
- Returns:
- Muttable map with categories.