BitMiracle.LibJpeg.Classic.jpeg_error_mgr.emit_message C# (CSharp) Method

emit_message() public method

Conditionally emit a trace or warning message.
The main reason for overriding this method would be to abort on warnings. This method calls output_message for message showing.
An application might override this method if it wanted to abort on warnings or change the policy about which messages to display.
public emit_message ( int msg_level ) : void
msg_level int The message severity level.
/// Values are:
/// -1: recoverable corrupt-data warning, may want to abort.
/// 0: important advisory messages (always display to user).
/// 1: first level of tracing detail.
/// 2, 3, ...: successively more detailed tracing messages. ///
return void
        public virtual void emit_message(int msg_level)
        {
            if (msg_level < 0)
            {
                /* It's a warning message.  Since corrupt files may generate many warnings,
                 * the policy implemented here is to show only the first warning,
                 * unless trace_level >= 3.
                 */
                if (m_num_warnings == 0 || m_trace_level >= 3)
                    output_message();

                /* Always count warnings in num_warnings. */
                m_num_warnings++;
            }
            else
            {
                /* It's a trace message.  Show it if trace_level >= msg_level. */
                if (m_trace_level >= msg_level)
                    output_message();
            }
        }