// Path: core/src/main/java/org/jboss/logmanager/ExtErrorManager.java
// public abstract class ExtErrorManager extends ErrorManager {
// 
//     /**
//      * Get the name corresponding to the given error code.
//      *
//      * @param code the error code
//      * @return the corresponding name (not {@code null})
//      */
//     protected String nameForCode(int code) {
//         switch (code) {
//             case CLOSE_FAILURE: return "CLOSE_FAILURE";
//             case FLUSH_FAILURE: return "FLUSH_FAILURE";
//             case FORMAT_FAILURE: return "FORMAT_FAILURE";
//             case GENERIC_FAILURE: return "GENERIC_FAILURE";
//             case OPEN_FAILURE: return "OPEN_FAILURE";
//             case WRITE_FAILURE: return "WRITE_FAILURE";
//             default: return "INVALID (" + code + ")";
//         }
//     }
// 
//     public void error(final String msg, final Exception ex, final int code) {
//         super.error(msg, ex, code);
//     }
// 
//     /**
//      * Convert the given error to a log record which can be published to handler(s) or stored.  Care should
//      * be taken not to publish the log record to a logger that writes to the same handler that produced the error.
//      *
//      * @param msg the error message (possibly {@code null})
//      * @param ex the error exception (possibly {@code null})
//      * @param code the error code
//      * @return the log record (not {@code null})
//      */
//     protected ExtLogRecord errorToLogRecord(String msg, Exception ex, int code) {
//         final ExtLogRecord record = new ExtLogRecord(Level.ERROR, "Failed to publish log record (%s[%d]): %s", ExtLogRecord.FormatStyle.PRINTF, getClass().getName());
//         final String codeStr = nameForCode(code);
//         record.setParameters(new Object[] {
//             codeStr,
//             Integer.valueOf(code),
//             msg,
//         });
//         record.setThrown(ex);
//         record.setLoggerName("");
//         return record;
//     }
// }
// 
// Path: core/src/main/java/org/jboss/logmanager/StandardOutputStreams.java
// @SuppressWarnings({"WeakerAccess", "unused"})
// public class StandardOutputStreams {
//     public static final PrintStream stdout = System.out;
//     public static final PrintStream stderr = System.err;
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param msg the message to print
//      */
//     public static void printError(final String msg) {
//         stderr.println(msg);
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param format the {@link java.util.Formatter format}
//      * @param args   the arguments for the format
//      */
//     public static void printError(final String format, final Object... args) {
//         stderr.printf(format, args);
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param cause the cause of the error, if not {@code null} the {@link Throwable#printStackTrace(PrintStream)}
//      *              writes to {@link #stderr stderr}
//      * @param msg   the message to print
//      */
//     public static void printError(final Throwable cause, final String msg) {
//         stderr.println(msg);
//         if (cause != null) {
//             cause.printStackTrace(stderr);
//         }
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param cause  the cause of the error, if not {@code null} the {@link Throwable#printStackTrace(PrintStream)}
//      *               writes to {@link #stderr stderr}
//      * @param format the {@link java.util.Formatter format}
//      * @param args   the arguments for the format
//      */
//     public static void printError(final Throwable cause, final String format, final Object... args) {
//         stderr.printf(format, args);
//         if (cause != null) {
//             cause.printStackTrace(stderr);
//         }
//     }
// }


import org.jboss.logmanager.ExtErrorManager;
import org.jboss.logmanager.StandardOutputStreams;
package org.jboss.logmanager.errormanager;


/**
 * An error manager which simply prints a message the system error stream.
 */
public class SimpleErrorManager extends ExtErrorManager {
    public void error(final String msg, final Exception ex, final int code) {
// Path: core/src/main/java/org/jboss/logmanager/ExtErrorManager.java
// public abstract class ExtErrorManager extends ErrorManager {
// 
//     /**
//      * Get the name corresponding to the given error code.
//      *
//      * @param code the error code
//      * @return the corresponding name (not {@code null})
//      */
//     protected String nameForCode(int code) {
//         switch (code) {
//             case CLOSE_FAILURE: return "CLOSE_FAILURE";
//             case FLUSH_FAILURE: return "FLUSH_FAILURE";
//             case FORMAT_FAILURE: return "FORMAT_FAILURE";
//             case GENERIC_FAILURE: return "GENERIC_FAILURE";
//             case OPEN_FAILURE: return "OPEN_FAILURE";
//             case WRITE_FAILURE: return "WRITE_FAILURE";
//             default: return "INVALID (" + code + ")";
//         }
//     }
// 
//     public void error(final String msg, final Exception ex, final int code) {
//         super.error(msg, ex, code);
//     }
// 
//     /**
//      * Convert the given error to a log record which can be published to handler(s) or stored.  Care should
//      * be taken not to publish the log record to a logger that writes to the same handler that produced the error.
//      *
//      * @param msg the error message (possibly {@code null})
//      * @param ex the error exception (possibly {@code null})
//      * @param code the error code
//      * @return the log record (not {@code null})
//      */
//     protected ExtLogRecord errorToLogRecord(String msg, Exception ex, int code) {
//         final ExtLogRecord record = new ExtLogRecord(Level.ERROR, "Failed to publish log record (%s[%d]): %s", ExtLogRecord.FormatStyle.PRINTF, getClass().getName());
//         final String codeStr = nameForCode(code);
//         record.setParameters(new Object[] {
//             codeStr,
//             Integer.valueOf(code),
//             msg,
//         });
//         record.setThrown(ex);
//         record.setLoggerName("");
//         return record;
//     }
// }
// 
// Path: core/src/main/java/org/jboss/logmanager/StandardOutputStreams.java
// @SuppressWarnings({"WeakerAccess", "unused"})
// public class StandardOutputStreams {
//     public static final PrintStream stdout = System.out;
//     public static final PrintStream stderr = System.err;
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param msg the message to print
//      */
//     public static void printError(final String msg) {
//         stderr.println(msg);
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param format the {@link java.util.Formatter format}
//      * @param args   the arguments for the format
//      */
//     public static void printError(final String format, final Object... args) {
//         stderr.printf(format, args);
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param cause the cause of the error, if not {@code null} the {@link Throwable#printStackTrace(PrintStream)}
//      *              writes to {@link #stderr stderr}
//      * @param msg   the message to print
//      */
//     public static void printError(final Throwable cause, final String msg) {
//         stderr.println(msg);
//         if (cause != null) {
//             cause.printStackTrace(stderr);
//         }
//     }
// 
//     /**
//      * Prints an error messages to {@link #stderr stderr}.
//      *
//      * @param cause  the cause of the error, if not {@code null} the {@link Throwable#printStackTrace(PrintStream)}
//      *               writes to {@link #stderr stderr}
//      * @param format the {@link java.util.Formatter format}
//      * @param args   the arguments for the format
//      */
//     public static void printError(final Throwable cause, final String format, final Object... args) {
//         stderr.printf(format, args);
//         if (cause != null) {
//             cause.printStackTrace(stderr);
//         }
//     }
// }


// Path: core/src/main/java/org/jboss/logmanager/errormanager/SimpleErrorManager.java
import org.jboss.logmanager.ExtErrorManager;
import org.jboss.logmanager.StandardOutputStreams;

package org.jboss.logmanager.errormanager;


/**
 * An error manager which simply prints a message the system error stream.
 */
public class SimpleErrorManager extends ExtErrorManager {
    public void error(final String msg, final Exception ex, final int code) {
        StandardOutputStreams.printError(ex, "LogManager error of type %s: %s%n", nameForCode(code), msg);