/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira.junit
 */
package net.ranides.assira.junit;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class LogMessage {
    
    private final int level;
            
    private final String text;
    
    private final Throwable error;

    LogMessage(int level, String text, Throwable error) {
        this.level = level;
        this.text = (error==null) ? text : text + " @ " + error.toString();
        this.error = error;
    }
    
    public String text() {
        return text;
    }
  
    public int level() {
        return level;
    }
    
    public Throwable error() {
        return error;
    }

    @Override
    public String toString() {
        return text;
    }
    
}
