Changeset b2da629


Ignore:
Timestamp:
Aug 8, 2012 5:07:28 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
0a751a3
Parents:
37a542c
Message:
  • Datagrams: Remove static logs
Location:
core/java/src/net/i2p/client/datagram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/datagram/I2PDatagramDissector.java

    r37a542c rb2da629  
    1212import java.io.IOException;
    1313
     14import net.i2p.I2PAppContext;
    1415import net.i2p.crypto.DSAEngine;
    1516import net.i2p.crypto.SHA256Generator;
     
    2829public final class I2PDatagramDissector {
    2930
    30     private static Log _log = new Log(I2PDatagramDissector.class);
    31 
    3231    private static final int DGRAM_BUFSIZE = 32768;
    3332
     
    3534    private final SHA256Generator hashGen = SHA256Generator.getInstance();
    3635
    37     private Hash rxHash = null;
     36    private Hash rxHash;
    3837
    3938    private Signature rxSign;
     
    4342    private final byte[] rxPayload = new byte[DGRAM_BUFSIZE];
    4443
    45     private int rxPayloadLen = 0;
    46    
    47     private boolean valid = false;
     44    private int rxPayloadLen;
     45   
     46    private boolean valid;
    4847
    4948    /**
     
    5554    /**
    5655     * Load an I2P repliable datagram into the dissector.
     56     * Does NOT verify the signature.
    5757     *
    5858     * @param dgram I2P repliable datagram to be loader
     
    8282            assert this.hashGen.calculateHash(this.extractPayload()).equals(this.rxHash);
    8383        } catch (IOException e) {
    84             _log.error("Caught IOException - INCONSISTENT STATE!", e);
     84            Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
     85            log.error("Caught IOException - INCONSISTENT STATE!", e);
    8586        } catch(AssertionError e) {
    86             _log.error("Assertion failed!", e);
     87            Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
     88            log.error("Assertion failed!", e);
    8789        }
    8890       
     
    160162            retDest.fromByteArray(this.rxDest.toByteArray());
    161163        } catch (DataFormatException e) {
    162             _log.error("Caught DataFormatException", e);
     164            Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
     165            log.error("Caught DataFormatException", e);
    163166            return null;
    164167        }
  • core/java/src/net/i2p/client/datagram/I2PDatagramMaker.java

    r37a542c rb2da629  
    1212import java.io.IOException;
    1313
     14import net.i2p.I2PAppContext;
    1415import net.i2p.client.I2PSession;
    1516import net.i2p.crypto.DSAEngine;
     
    2728public final class I2PDatagramMaker {
    2829
    29     private static Log _log = new Log(I2PDatagramMaker.class);
    30 
    3130    private static final int DGRAM_BUFSIZE = 32768;
    3231
     
    3433    private final DSAEngine dsaEng = DSAEngine.getInstance();
    3534
    36     private SigningPrivateKey sxPrivKey = null;
    37     private byte[] sxDestBytes = null;
     35    private SigningPrivateKey sxPrivKey;
     36    private byte[] sxDestBytes;
    3837
    3938    private final ByteArrayOutputStream sxDGram = new ByteArrayOutputStream(DGRAM_BUFSIZE);
     
    7978            return sxDGram.toByteArray();
    8079        } catch (IOException e) {
    81             _log.error("Caught IOException", e);
     80            Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramMaker.class);
     81            log.error("Caught IOException", e);
    8282            return null;
    8383        } catch (DataFormatException e) {
    84             _log.error("Caught DataFormatException", e);
     84            Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramMaker.class);
     85            log.error("Caught DataFormatException", e);
    8586            return null;
    8687        }
Note: See TracChangeset for help on using the changeset viewer.