Codota Logo
Logger.debug
Code IndexAdd Codota to your IDE (free)

How to use
debug
method
in
org.postgresql.core.Logger

Best Java code snippets using org.postgresql.core.Logger.debug (Showing top 20 results out of 315)

  • Common ways to obtain Logger
private void myMethod () {
Logger l =
  • Codota Iconnew Logger(nextConnectionID++)
  • Codota IconBaseConnection baseConnection;baseConnection.getLogger()
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

public void debug(String str) {
  debug(str, null);
}
origin: postgresql/postgresql

private void debug(String s) {
  logger.debug("XAResource " + Integer.toHexString(this.hashCode()) + ": " + s);
}
origin: postgresql/postgresql

/**
 * @return the timeout from the URL, in milliseconds
 */
private static long timeout(Properties props)
{
  String timeout = props.getProperty("loginTimeout");
  if (timeout != null) {
    try {
      return (long) (Float.parseFloat(timeout) * 1000);
    } catch (NumberFormatException e) {
      // Log level isn't set yet, so this doesn't actually 
      // get printed.
      logger.debug("Couldn't parse loginTimeout value: " + timeout);
    }
  }
  return DriverManager.getLoginTimeout() * 1000;
}
origin: postgresql/postgresql

private SQLWarning receiveNotification() throws IOException {
  String warnMsg = pgStream.ReceiveString();
  // Strip out the severity field so we have consistency with
  // the V3 protocol.  SQLWarning.getMessage should return just
  // the actual message.
  //
  int severityMark = warnMsg.indexOf(":");
  warnMsg = warnMsg.substring(severityMark+1).trim();
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg + ")");
  return new SQLWarning(warnMsg);
}
origin: postgresql/postgresql

private SQLException receiveErrorMessage() throws IOException {
  String errorMsg = pgStream.ReceiveString().trim();
  if (logger.logDebug())
    logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
  return new PSQLException(errorMsg, PSQLState.UNKNOWN_STATE);
}
origin: postgresql/postgresql

public void close() {
  if (closed)
    return ;
  try
  {
    if (logger.logDebug())
      logger.debug(" FE=> Terminate");
    pgStream.SendChar('X');
    pgStream.flush();
    pgStream.close();
  }
  catch (IOException ioe)
  {
    // Forget it.
    if (logger.logDebug())
      logger.debug("Discarding IOException on close:", ioe);
  }
  closed = true;
}
origin: postgresql/postgresql

private void sendSync() throws IOException {
  if (logger.logDebug())
    logger.debug(" FE=> Sync");
  pgStream.SendChar('S');     // Sync
  pgStream.SendInteger4(4); // Length
  pgStream.flush();
}
origin: postgresql/postgresql

private String receiveCommandStatus() throws IOException {
  //TODO: better handle the msg len
  int l_len = pgStream.ReceiveInteger4();
  //read l_len -5 bytes (-4 for l_len and -1 for trailing \0)
  String status = pgStream.ReceiveString(l_len - 5);
  //now read and discard the trailing \0
  pgStream.Receive(1);
  if (logger.logDebug())
    logger.debug(" <=BE CommandStatus(" + status + ")");
  return status;
}
origin: postgresql/postgresql

protected void sendQuery(V2Query query, SimpleParameterList params, String queryPrefix) throws IOException {
  if (logger.logDebug())
    logger.debug(" FE=> Query(\"" + (queryPrefix == null ? "" : queryPrefix) + query.toString(params) + "\")");
  pgStream.SendChar('Q');
  Writer encodingWriter = pgStream.getEncodingWriter();
  if (queryPrefix != null)
    encodingWriter.write(queryPrefix);
  String[] fragments = query.getFragments();
  for (int i = 0 ; i < fragments.length; ++i)
  {
    encodingWriter.write(fragments[i]);
    if (i < params.getParameterCount())
      params.writeV2Value(i + 1, encodingWriter);
  }
  encodingWriter.write(0);
  pgStream.flush();
}
origin: postgresql/postgresql

private void receiveAsyncNotify() throws IOException {
  int pid = pgStream.ReceiveInteger4();
  String msg = pgStream.ReceiveString();
  if (logger.logDebug())
    logger.debug(" <=BE AsyncNotify(pid=" + pid + ",msg=" + msg + ")");
  protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid));
}
origin: postgresql/postgresql

private void sendDescribeStatement(SimpleQuery query, SimpleParameterList params, boolean describeOnly) throws IOException {
  // Send Statement Describe
  if (logger.logDebug())
  {
    logger.debug(" FE=> Describe(statement=" + query.getStatementName()+")");
  }
  byte[] encodedStatementName = query.getEncodedStatementName();
  // Total size = 4 (size field) + 1 (describe type, 'S') + N + 1 (portal name)
  int encodedSize = 4 + 1 + (encodedStatementName == null ? 0 : encodedStatementName.length) + 1;
  pgStream.SendChar('D');                     // Describe
  pgStream.SendInteger4(encodedSize);         // Message size
  pgStream.SendChar('S');                     // Describe (Statement);
  if (encodedStatementName != null)
    pgStream.Send(encodedStatementName);    // Statement name
  pgStream.SendChar(0);                       // end message
  pendingDescribeStatementQueue.add(new Object[]{query, params, new Boolean(describeOnly), query.getStatementName()});
  pendingDescribePortalQueue.add(query);
  query.setStatementDescribed(true);
  query.setPortalDescribed(true);
}
origin: postgresql/postgresql

private void sendExecute(SimpleQuery query, Portal portal, int limit) throws IOException {
  //
  // Send Execute.
  //
  if (logger.logDebug())
  {
    logger.debug(" FE=> Execute(portal=" + portal + ",limit=" + limit + ")");
  }
  byte[] encodedPortalName = (portal == null ? null : portal.getEncodedPortalName());
  int encodedSize = (encodedPortalName == null ? 0 : encodedPortalName.length);
  // Total size = 4 (size field) + 1 + N (source portal) + 4 (max rows)
  pgStream.SendChar('E');              // Execute
  pgStream.SendInteger4(4 + 1 + encodedSize + 4);  // message size
  if (encodedPortalName != null)
    pgStream.Send(encodedPortalName); // portal name
  pgStream.SendChar(0);                 // portal name terminator
  pgStream.SendInteger4(limit);       // row limit
  pendingExecuteQueue.add(new Object[] { query, portal });
}
origin: postgresql/postgresql

private void receiveAsyncNotify() throws IOException {
  int msglen = pgStream.ReceiveInteger4();
  int pid = pgStream.ReceiveInteger4();
  String msg = pgStream.ReceiveString();
  String param = pgStream.ReceiveString();
  protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid, param));
  if (logger.logDebug())
    logger.debug(" <=BE AsyncNotify(" + pid + "," + msg + "," + param + ")");
}
origin: postgresql/postgresql

private void sendStartupPacket(PGStream pgStream, String user, String database, Logger logger) throws IOException {
  //  4: total size including self
  //  2: protocol major
  //  2: protocol minor
  // 64: database name
  // 32: user name
  // 64: options
  // 64: unused
  // 64: tty
  if (logger.logDebug())
    logger.debug(" FE=> StartupPacket(user=" + user + ",database=" + database + ")");
  pgStream.SendInteger4(4 + 4 + 64 + 32 + 64 + 64 + 64);
  pgStream.SendInteger2(2); // protocol major
  pgStream.SendInteger2(0); // protocol minor
  pgStream.Send(database.getBytes("UTF-8"), 64);
  pgStream.Send(user.getBytes("UTF-8"), 32);
  pgStream.Send(new byte[64]);  // options
  pgStream.Send(new byte[64]);  // unused
  pgStream.Send(new byte[64]);  // tty
  pgStream.flush();
}
origin: postgresql/postgresql

private SQLException receiveErrorResponse() throws IOException {
  // it's possible to get more than one error message for a query
  // see libpq comments wrt backend closing a connection
  // so, append messages to a string buffer and keep processing
  // check at the bottom to see if we need to throw an exception
  int elen = pgStream.ReceiveInteger4();
  String totalMessage = pgStream.ReceiveString(elen - 4);
  ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage, logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE ErrorMessage(" + errorMsg.toString() + ")");
  return new PSQLException(errorMsg);
}
origin: postgresql/postgresql

private SQLWarning receiveNoticeResponse() throws IOException {
  int nlen = pgStream.ReceiveInteger4();
  ServerErrorMessage warnMsg = new ServerErrorMessage(pgStream.ReceiveString(nlen - 4), logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg.toString() + ")");
  return new PSQLWarning(warnMsg);
}
origin: postgresql/postgresql

private Field[] receiveFields() throws IOException
{
  int size = pgStream.ReceiveInteger2();
  Field[] fields = new Field[size];
  if (logger.logDebug())
    logger.debug(" <=BE RowDescription(" + fields.length + ")");
  for (int i = 0; i < fields.length; i++)
  {
    String columnLabel = pgStream.ReceiveString();
    int typeOid = pgStream.ReceiveInteger4();
    int typeLength = pgStream.ReceiveInteger2();
    int typeModifier = pgStream.ReceiveInteger4();
    fields[i] = new Field(columnLabel, columnLabel, typeOid, typeLength, typeModifier, 0, 0);
  }
  return fields;
}
origin: postgresql/postgresql

private void sendFastpathCall(int fnid, FastpathParameterList params) throws IOException {
  // Send call.
  int count = params.getParameterCount();
  if (logger.logDebug())
    logger.debug(" FE=> FastpathCall(fnid=" + fnid + ",paramCount=" + count + ")");
  pgStream.SendChar('F');
  pgStream.SendChar(0);
  pgStream.SendInteger4(fnid);
  pgStream.SendInteger4(count);
  for (int i = 1; i <= count; ++i)
    params.writeV2FastpathValue(i, pgStream);
  pgStream.flush();
}
origin: postgresql/postgresql

private void sendCloseStatement(String statementName) throws IOException {
  //
  // Send Close.
  //
  if (logger.logDebug())
  {
    logger.debug(" FE=> CloseStatement(" + statementName + ")");
  }
  byte[] encodedStatementName = Utils.encodeUTF8(statementName);
  // Total size = 4 (size field) + 1 (close type, 'S') + N + 1 (statement name)
  pgStream.SendChar('C');              // Close
  pgStream.SendInteger4(4 + 1 + encodedStatementName.length + 1);  // message size
  pgStream.SendChar('S');              // Close (Statement)
  pgStream.Send(encodedStatementName); // statement to close
  pgStream.SendChar(0);                // statement name terminator
}
origin: postgresql/postgresql

private void sendClosePortal(String portalName) throws IOException {
  //
  // Send Close.
  //
  if (logger.logDebug())
  {
    logger.debug(" FE=> ClosePortal(" + portalName + ")");
  }
  byte[] encodedPortalName = (portalName == null ? null : Utils.encodeUTF8(portalName));
  int encodedSize = (encodedPortalName == null ? 0 : encodedPortalName.length);
  // Total size = 4 (size field) + 1 (close type, 'P') + 1 + N (portal name)
  pgStream.SendChar('C');              // Close
  pgStream.SendInteger4(4 + 1 + 1 + encodedSize);  // message size
  pgStream.SendChar('P');              // Close (Portal)
  if (encodedPortalName != null)
    pgStream.Send(encodedPortalName);
  pgStream.SendChar(0);                // unnamed portal
}
org.postgresql.coreLoggerdebug

Popular methods of Logger

  • <init>
  • getLogLevel
  • info
  • log
  • logDebug
  • logInfo
  • setLogLevel

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getSharedPreferences (Context)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now