com.codereligion.cherry.junit.logback
Class LogSpec

java.lang.Object
  extended by com.codereligion.cherry.junit.logback.LogSpec

public class LogSpec
extends Object

Holds a Logger and a Level which specify the log events which should be recorded.

Since:
17.03.2015
Author:
Sebastian Gröbler

Constructor Summary
LogSpec(Class<?> type, ch.qos.logback.classic.Level level)
          Creates a new instance which will fetch the Logger specified by the given type and which will use the given level.
LogSpec(String loggerName, ch.qos.logback.classic.Level level)
          Creates a new instance which will fetch the Logger specified by the given loggerName and which will use the given level.
 
Method Summary
 boolean equals(Object obj)
           
 ch.qos.logback.classic.Level getLevel()
          The Level associated witht this spec.
 ch.qos.logback.classic.Logger getLogger()
          The Logger associated with this spec.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogSpec

public LogSpec(Class<?> type,
               ch.qos.logback.classic.Level level)
Creates a new instance which will fetch the Logger specified by the given type and which will use the given level.

Parameters:
type - the type which identifies the logger
level - the level to use
Throws:
IllegalArgumentException - when any of the given arguments are null

LogSpec

public LogSpec(String loggerName,
               ch.qos.logback.classic.Level level)
Creates a new instance which will fetch the Logger specified by the given loggerName and which will use the given level.

Parameters:
loggerName - the name which identifies the logger
level - the level to use
Throws:
IllegalArgumentException - when any of the given arguments are null
Method Detail

getLevel

public ch.qos.logback.classic.Level getLevel()
The Level associated witht this spec.

Returns:
the level

getLogger

public ch.qos.logback.classic.Logger getLogger()
The Logger associated with this spec.

Returns:
the logger

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All rights reserved.