001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005package edu.wpi.first.epilogue.logging.errors; 006 007import edu.wpi.first.epilogue.logging.ClassSpecificLogger; 008 009/** An error handler implementation that prints error information to the console. */ 010public class ErrorPrinter implements ErrorHandler { 011 /** Default constructor. */ 012 public ErrorPrinter() {} 013 014 @Override 015 public void handle(Throwable exception, ClassSpecificLogger<?> logger) { 016 System.err.println( 017 "[EPILOGUE] An error occurred while logging an instance of " 018 + logger.getLoggedType().getName() 019 + ": " 020 + exception.getMessage()); 021 } 022}