コード例 #1
0
        /// <summary> Handle logging.
        /// *
        /// </summary>
        /// <param name="String">message to log
        ///
        /// </param>
        private void log(int level, Object message)
        {
            String out_Renamed;

            /*
             *  now,  see if the logging stacktrace is on
             *  and modify the message to suit
             */
            //UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to ' ' which has different behavior. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1100"'
            if (showStackTrace() && (message is System.Exception || message is System.Exception))
            {
                //UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to ' ' which has different behavior. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1100"'
                out_Renamed = StringUtils.stackTrace((System.Exception)message);
            }
            else
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.Object.toString' may return a different value. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1043"'
                out_Renamed = message.ToString();
            }

            /*
             *  just log it, as we are guaranteed now to have some
             *  kind of logger - save the if()
             */
            logSystem.LogVelocityMessage(level, out_Renamed);
        }
コード例 #2
0
	/// <summary>
	/// dumps the log messages this logger is holding into a new logger
	/// </summary>
	public virtual void DumpLogMessages(LogSystem newLogger) {
	    lock(this) {
		if (!(pendingMessages.Count == 0)) {
		    // iterate and log each individual message...
		    foreach(Object[] data in pendingMessages) {
			newLogger.LogVelocityMessage(((Int32)data[0]), (String)data[1]);
		    }
		}
	    }
	}
コード例 #3
0
ファイル: PrimordialLogSystem.cs プロジェクト: minskowl/MY
 /// <summary>
 /// dumps the log messages this logger is holding into a new logger
 /// </summary>
 public virtual void DumpLogMessages(LogSystem newLogger)
 {
     lock (this) {
         if (!(pendingMessages.Count == 0))
         {
             // iterate and log each individual message...
             foreach (Object[] data in pendingMessages)
             {
                 newLogger.LogVelocityMessage(((Int32)data[0]), (String)data[1]);
             }
         }
     }
 }