net.sourceforge.tess4j.util.LoggerConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tess4j Show documentation
Show all versions of tess4j Show documentation
# Tess4J
## Description:
A Java JNA wrapper for Tesseract OCR API.
Tess4J is released and distributed under the Apache License, v2.0.
## Features:
The library provides optical character recognition (OCR) support for:
TIFF, JPEG, GIF, PNG, and BMP image formats
Multi-page TIFF images
PDF document format
/**
* Copyright @ 2015 Quan Nguyen
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package net.sourceforge.tess4j.util;
import org.slf4j.bridge.SLF4JBridgeHandler;
/**
* Logging configuration.
*
* @author O.J. Sousa Rodrigues
*/
public enum LoggerConfig {
INSTANCE;
private boolean isLoaded = false;
/**
* This method loads the Logger configuration.
*
* @return true if the Logger configuration was loaded successfully.
*/
public boolean loadConfig() {
try {
if (!isLoaded) {
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
this.isLoaded = true;
}
} catch (final Exception e) {
System.err.println("Logger configuration could not be loaded.");
}
return this.isLoaded;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy