Changeset 31712


Ignore:
Timestamp:
2017-05-29T18:49:10+12:00 (7 years ago)
Author:
ak19
Message:

Logging on exception should happen regardless of whether the DEBUG flag is on or not. Exceptions are not debugging information. Also made some minor changes to a few comments.

Location:
main/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/SafeProcess.java

    r31707 r31712  
    917917    /*
    918918    // On Macs (all Unix?) can't get the child processes of a process once it's been destroyed
    919     macTerminateSubProcessesRecursively(pid, p); // pid, true) 
     919    macTerminateSubProcessesRecursively(pid, p);
    920920    */
    921921   
    922922    if(pid == -1) {
    923         p.destroy(); // at minimum, will have no effect if the process had already terminated
     923        p.destroy(); // at minimum. Will have no effect if the process had already terminated
    924924    } else {
    925925        boolean forceKill = true;
     
    936936
    937937
    938 // UNUSED and INCOMPLETE
     938// UNUSED and INCOMPLETE METHOD
    939939// But if this method is needed, then need to parse childpids printed by "pgrep -P pid" and write recursive step
    940940// The childpids are probably listed one per line, see https://unix.stackexchange.com/questions/117227/why-pidof-and-pgrep-are-behaving-differently
     
    14221422
    14231423    public static void log(String msg, Exception e) { // Print stack trace on the exception
    1424     if(DEBUG == 0) return;
    14251424    //logger.error(msg, e);
    14261425
     
    14331432
    14341433    public static void log(Exception e) {
    1435     if(DEBUG == 0) return;     
    14361434    //logger.error(e);
    14371435
  • main/trunk/greenstone3/src/java/org/greenstone/util/SafeProcess.java

    r31707 r31712  
    918918    /*
    919919    // On Macs (all Unix?) can't get the child processes of a process once it's been destroyed
    920     macTerminateSubProcessesRecursively(pid, p); // pid, true) 
     920    macTerminateSubProcessesRecursively(pid, p);
    921921    */
    922922   
    923923    if(pid == -1) {
    924         p.destroy(); // at minimum, will have no effect if the process had already terminated
     924        p.destroy(); // at minimum. Will have no effect if the process had already terminated
    925925    } else {
    926926        boolean forceKill = true;
     
    937937
    938938
    939 // UNUSED and INCOMPLETE
     939// UNUSED and INCOMPLETE METHOD
    940940// But if this method is needed, then need to parse childpids printed by "pgrep -P pid" and write recursive step
    941941// The childpids are probably listed one per line, see https://unix.stackexchange.com/questions/117227/why-pidof-and-pgrep-are-behaving-differently
     
    14231423
    14241424    public static void log(String msg, Exception e) { // Print stack trace on the exception
    1425     if(DEBUG == 0) return;
    14261425    logger.error(msg, e);
    14271426
     
    14341433
    14351434    public static void log(Exception e) {
    1436     if(DEBUG == 0) return;     
    14371435    logger.error(e);
    14381436
Note: See TracChangeset for help on using the changeset viewer.