Examples of LogEvent


Examples of org.gudy.azureus2.core3.logging.LogEvent

        iCol++;
      }
      oldBlockInfo = newBlockInfo;
    } catch (Exception e) {
      Logger.log(new LogEvent(LogIDs.GUI, "drawing piece map", e));
    } finally {
      gcImg.dispose();
    }

    topLabel.setText(MessageText.getString("PiecesView.BlockView.Header",
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

            public void widgetDisposed(DisposeEvent event)
            {
              try {
                removeWindow(shell);
              } catch (Exception e) {
                Logger.log(new LogEvent(LogIDs.GUI, "removeWindow", e));
              }
            }
        });
        shell.addListener(SWT.Show, new Listener() {
          public void handleEvent(Event event) {
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

             
              throw( e );
            }
            
             if (Logger.isEnabled())
              Logger.log(new LogEvent(LOGID, "Failed to open '" + file.toString()  + "', retrying", e));
           
            Thread.sleep(500);
          }
        }
       
        BDecoder  decoder = new BDecoder();
       
        if ( recovery_mode ){
         
          decoder.setRecoveryMode( true );
        }
       
        Map  res = decoder.decodeStream(bin, !skip_key_intern);
       
        if ( using_backup && !recovery_mode ){
     
          Debug.out( "Load of '" + original_file_name + "' had to revert to backup file" );
        }
       
        return( res );
       
      }catch( Throwable e ){
       
        Debug.printStackTrace( e );
       
        try
          if (bin != null){
           
            bin.close();
           
            bin  = null;
          }
        } catch (Exception x) {
         
          Debug.printStackTrace( x );
        }
       
          // if we're not recovering then backup the file
       
        if ( !recovery_mode ){
         
           // Occurs when file is there but b0rked
            // copy it in case it actually contains useful data, so it won't be overwritten next save
     
          File bad;
         
          int  bad_id = 0;
         
          while(true){
           
            File  test = new File( parent_dir, file.getName() + ".bad" + (bad_id==0?"":(""+bad_id)));
           
            if ( !test.exists()){
             
              bad  = test;
             
              break;
            }
           
            bad_id++;
          }

          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, "Read of '"
                + original_file_name + "' failed, decoding error. " + "Renaming to "
                + bad.getName()));
 
            // copy it so its left in place for possible recovery
         
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

      Matcher matcher = pat.matcher(f.getParent());
      if (matcher.find()) {
        String sVolume = matcher.group();
        File fVolume = new File(sVolume);
        if (!fVolume.isDirectory()) {
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, sVolume
              + " is not mounted or not available."));
          return false;
        }
      }
    }
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

  private static void initializeSingleton() {
    try {
      class_mon.enter();
      singleton = new PlatformManagerImpl();
    } catch (Throwable e) {
      Logger.log(new LogEvent(LOGID, "Failed to initialize platform manager"
          + " for Unix Compatable OS", e));
    } finally {
      class_mon.exit();
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

        File old_home = new File(old_home_path);
        if (old_home.exists()) { //migrate
          String msg = "Migrating unix user config dir [" + old_home_path
              + "] ===> [" + temp_user_path + "]";
          System.out.println(msg);
          Logger.log(new LogEvent(LOGID,
              "SystemProperties::getUserPath(Unix): " + msg));
          try {
            old_home.renameTo(home);
          } catch (Throwable t) {
            t.printStackTrace();
            Logger.log(new LogEvent(LOGID, "migration rename failed:", t));
          }
        }
      }
    }
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

       
        name  = getName() + " [" + id + "]";
       
        start_time = SystemTime.getCurrentTime();
       
        Logger.log(new LogEvent( LOGID, "DMRequest start: " + name ));
       
      }catch( Throwable e ){
      }
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

    boolean  ok )
  {
    if ( DEBUG ){
     
      try{
        Logger.log(new LogEvent( LOGID, "DMRequest end: " + name + ",ok=" + ok + ", time=" + ( SystemTime.getCurrentTime() - start_time )));
       
      }catch( Throwable e ){
      }
    } 
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

           
            String  str = "valid=" + resumeValid + ",not done=" + total_not_done + ",done=" + total_done +
                    ",started=" + total_started + ",recheck=" + total_recheck + ",rc all=" + recheck_all +
                    ",full=" + check_is_full_check;
           
            Logger.log(new LogEvent(disk_manager, LOGID, str ));
          }

          for (int i = 0; i < pieces.length; i++){
           
            check_position  = i;
           
            DiskManagerPiece  dm_piece  = pieces[i];
           
            disk_manager.setPercentDone(((i + 1) * 1000) / disk_manager.getNbPieces() );
           
            boolean pieceCannotExist = false;
           
            byte  piece_state = resume_pieces[i];
           
              // valid resume data means that the resume array correctly represents
              // the state of pieces on disk, be they done or not
           
            if ( piece_state == PIECE_DONE || !resumeValid || recheck_all ){
           
                // at least check that file sizes are OK for this piece to be valid
             
              DMPieceList list = disk_manager.getPieceList(i);
             
              for (int j=0;j<list.size();j++){
               
                DMPieceMapEntry  entry = list.get(j);
               
                Long  file_size     = (Long)file_sizes.get(entry.getFile());
               
                if ( file_size == null ){
                 
                  piece_state  = PIECE_NOT_DONE;
                  pieceCannotExist = true;
                 
                  if (Logger.isEnabled())
                    Logger.log(new LogEvent(disk_manager, LOGID,
                        LogEvent.LT_WARNING, "Piece #" + i
                            + ": file is missing, " + "fails re-check."));
 
                  break;
                }
               
                long  expected_size   = entry.getOffset() + entry.getLength();
               
                if ( file_size.longValue() < expected_size ){
                 
                  piece_state  = PIECE_NOT_DONE;
                  pieceCannotExist = true;
                 
                  if (Logger.isEnabled())
                    Logger.log(new LogEvent(disk_manager, LOGID,
                        LogEvent.LT_WARNING, "Piece #" + i
                            + ": file is too small, fails re-check. File size = "
                            + file_size + ", piece needs " + expected_size));
 
                  break;
View Full Code Here

Examples of org.gudy.azureus2.core3.logging.LogEvent

  log(
    String  str )
  {
    if ( Logger.isEnabled()){

      Logger.log(new LogEvent(LOGID, "GenericMessaging (indirect):" + str ));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.