Skip to content

Instantly share code, notes, and snippets.

View HashRaygoza's full-sized avatar

David Raygoza Gómez HashRaygoza

View GitHub Profile
package bitacora.subnivel;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Control {
private final static Logger LOGGER = Logger.getLogger("bitacora.subnivel.Control");
public void controlar(){
LOGGER.log(Level.INFO, "Proceso exitoso");
package bitacora.subnivel;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Utilidades {
private final static Logger LOGGER = Logger.getLogger("bitacora.subnivel.Utilidades");
public void funcionDudosa(){
LOGGER.log(Level.SEVERE, "ERROR MASIVO");
package bitacora.subnivel.under;
import java.util.logging.Level;
import java.util.logging.Logger;
public class InternalSys {
private final static Logger LOGGER = Logger.getLogger("bitacora.subnivel.under.InternalSys");
public void llamadaSistema(){
LOGGER.log(Level.WARNING, "Ocurrio un error de acceso en 0xFF");
package bitacora;
import bitacora.subnivel.Control;
import bitacora.subnivel.Utilidades;
import bitacora.subnivel.under.InternalSys;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
@HashRaygoza
HashRaygoza / maven_package_exec_fat_jar.txt
Last active September 12, 2016 22:13 — forked from ppatierno/maven_package_exec_fat_jar.txt
Packaging an executable fat JAR with Apache Maven
Three ways to create an executable and fat JAR with Maven :
maven-jar-plugin (it doesn't add dependencies inside the final JAR, they have to be in the classpath)
Don't forget it goes between the build and plugins tags.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
mvn archetype:generate -DgroupId=mx.hashCode.test -DartifactId=MavenCommand -DinteractiveMode=false
<dependencies>
<dependency>
<groupId>idGrupo</groupId>
<artifactId>IdArtefacto</artifactId>
<version>verLibreria</version>
</dependency>
</dependencies>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
@HashRaygoza
HashRaygoza / pom.xml
Created April 18, 2017 18:38
Archivo pom.xml para iText7
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mx.hashSoft</groupId>
<artifactId>iText7</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.itextpdf</groupId>
@HashRaygoza
HashRaygoza / EventoPagina.java
Created April 18, 2017 18:40
Manejador de Evento de pagina en iText 7, agrega pie de pagina y encabezado
package mx.hashsoft.itext7;
import com.itextpdf.kernel.events.Event;
import com.itextpdf.kernel.events.IEventHandler;
import com.itextpdf.kernel.events.PdfDocumentEvent;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.layout.Canvas;