cz.cuni.amis.pogamut.base.utils.logging
Class LogCategories

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.logging.AbstractLogCategories
      extended by 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.


Constructor Summary
LogCategories()
           
 
Method Summary
protected  java.util.Map<java.lang.String,LogCategory> getCategoriesInternal()
           
 LogCategory getCategory(java.lang.String name)
          Returns existing category by the name or adds new one.
 
Methods inherited from class cz.cuni.amis.pogamut.base.utils.logging.AbstractLogCategories
addLogCategory, getCategories, getCategoryNames, getCategoryNamesSorted, hasCategory, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogCategories

@Inject
public LogCategories()
Method Detail

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.