Changeset 95:ae1ad4c27e2b in finroc_plugins_runtime_construction


Ignore:
Timestamp:
08.06.2017 02:45:38 (2 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Message:

Improves log messages in tAdministrationService (port names instead of pointers)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tAdministrationService.cpp

    r94 r95  
    148148  if (source_port->GetFlag(cVOLATILE) && destination_port->GetFlag(cVOLATILE)) 
    149149  { 
    150     FINROC_LOG_PRINT(WARNING, "Cannot really persistently connect two network ports: ", source_port, ", ", destination_port); 
     150    FINROC_LOG_PRINT(WARNING, "Cannot really persistently connect two network ports: '", *source_port, "' and '", *destination_port, "'"); 
    151151  } 
    152152 
     
    171171  catch (const std::exception& e) 
    172172  { 
    173     result << "Could not connect ports '" << source_port << "' and '" << destination_port << "'. Reason: " << e.what(); 
     173    result << "Could not connect ports '" << (*source_port) << "' and '" << (*destination_port) << "'. Reason: " << e.what(); 
    174174    FINROC_LOG_PRINT(WARNING, result.str()); 
    175175    return result.str(); 
     
    179179  if (!source_port->IsConnectedTo(*destination_port)) 
    180180  { 
    181     result << "Could not connect ports '" << source_port << "' and '" << destination_port << "' (see output of connected Finroc program for details)."; 
     181    result << "Could not connect ports '" << (*source_port) << "' and '" << (*destination_port) << "' (see output of connected Finroc program for details)."; 
    182182    FINROC_LOG_PRINT(WARNING, result.str()); 
    183183  } 
    184184  else 
    185185  { 
    186     FINROC_LOG_PRINT(USER, "Connected ports ", source_port, " ", destination_port); 
     186    FINROC_LOG_PRINT(USER, "Connected ports '", *source_port, "' and '", *destination_port, "'"); 
    187187  } 
    188188  return result.str(); 
     
    211211      tCreateFrameworkElementAction* create_action = create_actions[create_action_index]; 
    212212      core::tFrameworkElement* parent = core::tRuntimeEnvironment::GetInstance().GetElement(parent_handle); 
    213       if (parent == NULL || (!parent->IsReady())) 
     213      if (parent == nullptr || (!parent->IsReady())) 
    214214      { 
    215215        error_message = "Parent not available. Cancelling remote module creation."; 
     
    221221      else 
    222222      { 
    223         FINROC_LOG_PRINT(USER, "Creating Module ", parent, "/", module_name); 
     223        FINROC_LOG_PRINT(USER, "Creating Module ", *parent, "/", module_name); 
    224224        std::unique_ptr<tConstructorParameters> parameters; 
    225225        if (create_action->GetParameterTypes() && create_action->GetParameterTypes()->Size() > 0) 
     
    344344  if (source_port->IsConnectedTo(*destination_port)) 
    345345  { 
    346     FINROC_LOG_PRINT(WARNING, "Could not disconnect ports ", source_port, " ", destination_port); 
    347   } 
    348   else 
    349   { 
    350     FINROC_LOG_PRINT(USER, "Disconnected ports ", source_port, " ", destination_port); 
     346    FINROC_LOG_PRINT(WARNING, "Could not disconnect ports '", *source_port, "' and '", *destination_port, "'"); 
     347  } 
     348  else 
     349  { 
     350    FINROC_LOG_PRINT(USER, "Disconnected ports '", *source_port, "' and '", *destination_port, "'"); 
    351351  } 
    352352} 
     
    361361  } 
    362362  port->DisconnectAll(); 
    363   FINROC_LOG_PRINT(USER, "Disconnected port ", port); 
     363  FINROC_LOG_PRINT(USER, "Disconnected port '", *port, "'"); 
    364364} 
    365365 
     
    692692        if (error_message.length() > 0) 
    693693        { 
    694           FINROC_LOG_PRINT(WARNING, "Setting value of port '", port, "' failed: ", error_message); 
     694          FINROC_LOG_PRINT(WARNING, "Setting value of port '", *port, "' failed: ", error_message); 
     695        } 
     696        if (input_stream.Remaining()) 
     697        { 
     698          FINROC_LOG_PRINT(WARNING, "Did not read all bytes in provided memory buffer"); 
    695699        } 
    696700      } 
    697701      catch (const std::exception& e) 
    698702      { 
    699         FINROC_LOG_PRINT(WARNING, "Setting value of port '", port, "' failed: ", e); 
     703        FINROC_LOG_PRINT(WARNING, "Setting value of port '", *port, "' failed: ", e); 
    700704        error_message = e.what(); 
    701705      } 
Note: See TracChangeset for help on using the changeset viewer.