Skip to content

Commit

Permalink
PoiLogManager
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1922055 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pjfanning committed Nov 24, 2024
1 parent e400a0c commit 924d8e7
Show file tree
Hide file tree
Showing 251 changed files with 2,477 additions and 500 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
Expand All @@ -32,6 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.logging.PoiLogManager;

/**
* This class contains code that demonstrates how to insert plain, numbered
Expand All @@ -50,7 +50,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
@SuppressWarnings({"java:S106","java:S4823"})
public class InCellLists {
private static final Logger LOG = LogManager.getLogger(InCellLists.class);
private static final Logger LOG = PoiLogManager.getLogger(InCellLists.class);


// This character looks like a solid, black, loser case letter 'o'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.logging.PoiLogManager;

/**
* Creates outlines.
*/
public class Outlines implements Closeable {
public static void main(String[] args)
throws IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Logger LOGGER = LogManager.getLogger(Outlines.class);
Logger LOGGER = PoiLogManager.getLogger(Outlines.class);
for (int i=1; i<=13; i++) {
try (Outlines o = new Outlines()) {
String log = (String) Outlines.class.getDeclaredMethod("test" + i).invoke(o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.nio.file.Files;
import java.util.ArrayList;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DataFormatter;
Expand Down Expand Up @@ -134,7 +134,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public class ToCSV {
private static final Logger LOG = LogManager.getLogger(ToCSV.class);
private static final Logger LOG = PoiLogManager.getLogger(ToCSV.class);

private Workbook workbook;
private ArrayList<ArrayList<String>> csvData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.FillPatternType;
Expand Down Expand Up @@ -77,7 +77,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* See <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>.
*/
public final class BigGridDemo {
private static final Logger LOG = LogManager.getLogger(BigGridDemo.class);
private static final Logger LOG = PoiLogManager.getLogger(BigGridDemo.class);

private static final Random rnd = new Random();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
import org.junit.jupiter.api.Test;

public class HSLFFileHandler extends SlideShowHandler {

private static final Logger LOGGER = LogManager.getLogger(HSLFFileHandler.class);
private static final Logger LOGGER = PoiLogManager.getLogger(HSLFFileHandler.class);

@Override
public void handleFile(InputStream stream, String path) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.Objects;
import java.util.Set;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
Expand All @@ -53,7 +53,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* </p>
*/
public class POIXMLDocumentPart {
private static final Logger LOG = LogManager.getLogger(POIXMLDocumentPart.class);
private static final Logger LOG = PoiLogManager.getLogger(POIXMLDocumentPart.class);

private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
private PackagePart packagePart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import java.io.IOException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.ooxml.POIXMLRelation.PackagePartConstructor;
import org.apache.poi.ooxml.POIXMLRelation.ParentPartConstructor;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
Expand All @@ -31,7 +31,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* Defines a factory API that enables sub-classes to create instances of <code>POIXMLDocumentPart</code>
*/
public abstract class POIXMLFactory {
private static final Logger LOGGER = LogManager.getLogger(POIXMLFactory.class);
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLFactory.class);

/**
* Create a POIXMLDocumentPart from existing package part and relation. This method is called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.InputStream;
import java.util.Iterator;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
Expand Down Expand Up @@ -51,7 +51,7 @@ public interface ParentPartConstructor {
POIXMLDocumentPart init(POIXMLDocumentPart parent, PackagePart part) throws IOException, XmlException;
}

private static final Logger LOGGER = LogManager.getLogger(POIXMLRelation.class);
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLRelation.class);

/**
* Describes the content stored in a part.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import javax.xml.xpath.XPathFactory;

import com.microsoft.schemas.compatibility.AlternateContentDocument;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.util.Internal;
import org.apache.poi.xslf.usermodel.XSLFShape;
import org.apache.xmlbeans.XmlCursor;
Expand All @@ -34,7 +34,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;

public final class XPathHelper {
private static final Logger LOG = LogManager.getLogger(XPathHelper.class);
private static final Logger LOG = PoiLogManager.getLogger(XPathHelper.class);

private static final String OSGI_ERROR =
"Schemas (*.xsb) for <CLASS> can't be loaded - usually this happens when OSGI " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException;
Expand Down Expand Up @@ -72,7 +72,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
/**
* Logger.
*/
private static final Logger LOG = LogManager.getLogger(OPCPackage.class);
private static final Logger LOG = PoiLogManager.getLogger(OPCPackage.class);

/**
* Default package access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.net.URISyntaxException;
import java.util.*;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
import org.apache.poi.ooxml.util.DocumentHelper;
Expand All @@ -37,7 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
public final class PackageRelationshipCollection implements Iterable<PackageRelationship> {

private static final Logger LOG = LogManager.getLogger(PackageRelationshipCollection.class);
private static final Logger LOG = PoiLogManager.getLogger(PackageRelationshipCollection.class);

/**
* Package relationships ordered by ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.nio.charset.StandardCharsets;
import java.util.regex.Pattern;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;

Expand All @@ -37,7 +37,7 @@ public final class PackagingURIHelper {
// FIXME: this class implements a lot of path joining and splitting logic that
// is already implemented in java.nio.file.Path.
// This class should heavily leverage Java library code to reduce the number of lines of code that POI has to maintain and test
private static final Logger LOG = LogManager.getLogger(PackagingURIHelper.class);
private static final Logger LOG = PoiLogManager.getLogger(PackagingURIHelper.class);

/**
* Package root URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.poi.UnsupportedFileFormatException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
Expand Down Expand Up @@ -63,7 +63,7 @@ public final class ZipPackage extends OPCPackage {
private static boolean useTempFilePackageParts = false;
private static boolean encryptTempFilePackageParts = false;

private static final Logger LOG = LogManager.getLogger(ZipPackage.class);
private static final Logger LOG = PoiLogManager.getLogger(ZipPackage.class);

/**
* Zip archive, as either a file on disk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

package org.apache.poi.openxml4j.opc.internal;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
Expand All @@ -38,7 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
@Beta
public final class EncryptedTempFilePackagePart extends PackagePart {
private static final Logger LOG = LogManager.getLogger(EncryptedTempFilePackagePart.class);
private static final Logger LOG = PoiLogManager.getLogger(EncryptedTempFilePackagePart.class);

/**
* Storage for the part data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

package org.apache.poi.openxml4j.opc.internal;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
Expand All @@ -39,7 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
@Beta
public final class TempFilePackagePart extends PackagePart {
private static final Logger LOG = LogManager.getLogger(TempFilePackagePart.class);
private static final Logger LOG = PoiLogManager.getLogger(TempFilePackagePart.class);

/**
* Storage for the part data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.StreamHelper;
Expand All @@ -37,7 +37,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* @see ContentTypeManager
*/
public class ZipContentTypeManager extends ContentTypeManager {
private static final Logger LOG = LogManager.getLogger(ZipContentTypeManager.class);
private static final Logger LOG = PoiLogManager.getLogger(ZipContentTypeManager.class);

/**
* Delegate constructor to the super constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.PackageNamespaces;
import org.apache.poi.openxml4j.opc.PackagePart;
Expand All @@ -49,7 +49,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* Zip part marshaller. This marshaller is use to save any part in a zip stream.
*/
public final class ZipPartMarshaller implements PartMarshaller {
private static final Logger LOG = LogManager.getLogger(ZipPartMarshaller.class);
private static final Logger LOG = PoiLogManager.getLogger(ZipPartMarshaller.class);

/**
* Save the specified part to the given stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.io.input.UnsynchronizedByteArrayInputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.poifs.crypt.temp.EncryptedTempData;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.TempFile;
Expand All @@ -36,7 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* @see ZipInputStreamZipEntrySource#setThresholdBytesForTempFiles(int)
*/
/* package */ class ZipArchiveFakeEntry extends ZipArchiveEntry implements Closeable {
private static final Logger LOG = LogManager.getLogger(ZipArchiveFakeEntry.class);
private static final Logger LOG = PoiLogManager.getLogger(ZipArchiveFakeEntry.class);

// how large a single entry in a zip-file should become at max
// can be overwritten via IOUtils.setByteArrayMaxOverride()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.opc.internal.InvalidZipException;
import org.apache.poi.util.Internal;
import org.apache.poi.util.Removal;
Expand All @@ -42,7 +42,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*/
@Internal
public class ZipSecureFile extends ZipFile {
private static final Logger LOG = LogManager.getLogger(ZipSecureFile.class);
private static final Logger LOG = PoiLogManager.getLogger(ZipSecureFile.class);
/* package */ static double MIN_INFLATE_RATIO = 0.01d;
/* package */ static final long DEFAULT_MAX_ENTRY_SIZE = 0xFFFFFFFFL;
/* package */ static final long DEFAULT_MAX_FILE_COUNT = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import javax.xml.crypto.dsig.keyinfo.KeyInfo;
import javax.xml.crypto.dsig.keyinfo.X509Data;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;

/**
* JSR105 key selector implementation using the ds:KeyInfo data of the signature
* itself.
*/
public class KeyInfoKeySelector extends KeySelector implements KeySelectorResult {

private static final Logger LOG = LogManager.getLogger(KeyInfoKeySelector.class);
private static final Logger LOG = PoiLogManager.getLogger(KeyInfoKeySelector.class);

private final List<X509Certificate> certChain = new ArrayList<>();

Expand Down
Loading

0 comments on commit 924d8e7

Please sign in to comment.