Esempio n. 1
0
 /// <summary>
 /// Handler for the informational messages send by the database server when processing the scripts.
 /// </summary>
 /// <param name="sender">The connection.</param>
 /// <param name="e">The <see cref="csql.DbMessageEventArgs"/> instance containing the message.</param>
 private void InfoMessageEventHandler(object sender, DbMessageEventArgs e)
 {
     if (GlobalSettings.Verbosity.Level >= e.TraceLevel)
     {
         if (GlobalSettings.Verbosity.TraceVerbose)
         {
             Trace.WriteLine(e.ToString());
         }
         else
         {
             if (e.TraceLevel <= TraceLevel.Warning)
             {
                 Trace.WriteLine(m_context.FormatError(e.TraceLevel, e.Message, e.LineNumber));
             }
             else
             {
                 Trace.WriteLine(e.Message);
             }
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Formats the error message for the output.
        /// </summary>
        /// <param name="severity">
        /// The severity of the (error) message.
        /// </param>
        /// <param name="message">
        /// The error message.
        /// </param>
        /// <param name="errorLineNumber">
        /// The line number where error was reported.
        /// </param>
        /// <returns>The formated message.</returns>
        internal static string FormatError(ProcessorContext processorContext, TraceLevel severity, string message, int errorLineNumber)
        {
            string error = processorContext.FormatError(severity, message, errorLineNumber);

            return(error);
        }