ILOG CPLEX defines several message channels for flexible control over message output:
cpxresults
for messages containing status and progress information;
cpxerror
for messages issued when a task cannot be completed;
cpxwarning
for messages issued when a nonfatal difficulty is encountered; or when an action taken may have side-effects; or when an assumption made may have side-effects;
cpxlog
for messages containing information that would not conventionally be displayed on screen but could be useful in a log file.
Output messages flow through message channels to destinations. Message channels are associated with destinations through their destination list. Messages from routines of the ILOG CPLEX Callable Library are assigned internally to one of those predefined channels. Those default channels are C pointers to ILOG CPLEX objects; they are initialized by CPXopenCPLEX()
; they are not global variables. Your application accesses these objects by calling the routine CPXgetchannels()
. You can use these predefined message channels for your own application messages. You can also define new channels.
Messages from multiple channels may be sent to one destination. All predefined ILOG CPLEX channels can be directed to a single file by a call to CPXsetlogfile()
. Similarly, all predefined ILOG CPLEX channels except cpxlog
can be directed to the screen by CPX_PARAM_SCRIND
. For a finer level of control, or to define destinations for application-specific messages, use the following message handling routines, all documented in the ILOG CPLEX Reference Manual:
CPXmsg()
sets logfile for predefined ILOG CPLEX channels;
CPXflushchannel()
flushes a channel to its associated destination;
CPXdisconnectchannel()
flushes a channel and clears its destination list;
CPXdelchannel()
flushes a channel, clears its destination list, frees memory for that channel;
CPXaddchannel()
adds a channel;
CPXaddfpdest()
adds a destination file to the list of destinations associated with a channel;
CPXdelfpdest()
deletes a destination from the destination list of a channel;
CPXaddfuncdest()
adds a destination function to a channel;
CPXdelfuncdest()
deletes a destination function to a channel;
Figure 8.1 ILOG CPLEX Message Handling Routines