static int SwarmLog(EVerbosityLevel Verbosity, ELogColour TextColour, IntPtr Message)
		{
			try
			{
				return GInstance.Log((EVerbosityLevel)Verbosity, (ELogColour)TextColour, FStringMarshaler.MarshalNativeToManaged(Message));
			}
			catch(Exception Ex)
			{
				DebugLog.Write(Ex.Message + "\n" + Ex.ToString());
				return 0;
			}
		}
		///////////////////////////////////////////////////////////////////////////
		
		public Int32 Log(EVerbosityLevel Verbosity, ELogColour TextColour, String Line)
		{
			LogDelegate DLog = Connection.Log;
			
			// Invoke the method, then wait for it to finish or to be notified that the connection dropped
			IAsyncResult Result = DLog.BeginInvoke(Verbosity, TextColour, Line, null, null);
			WaitHandle.WaitAny(new WaitHandle[]{ Result.AsyncWaitHandle, ConnectionDroppedEvent });
			
			// If the method completed normally, return the result
			if (Result.IsCompleted)
			{
				// If the invocation completed, success
				return DLog.EndInvoke(Result);
			}
			// Otherwise, error
			return Constants.ERROR_CONNECTION_DISCONNECTED;
		}
		private void EditorLog(EVerbosityLevel Verbosity, string Message)
		{
			if(SwarmInterfaceLogCppProc != null)
			{
				SwarmInterfaceLogCppProc(Verbosity, FStringMarshaler.MarshalManagedToNative(Message));
			}
			else
			{
				DebugLog.Write(Message);
			}
		}
		/**
		 * Adds a line of text to the Agent log window
		 *
		 * @param Verbosity the importance of this message
		 * @param TextColour the colour of the text
		 * @param Message the line of text to add
		 */
		public virtual Int32 Log(EVerbosityLevel Verbosity, ELogColour TextColour, String Message)
		{
			try
			{
				Connection.Log(Verbosity, TextColour, Message);
			}
			catch (Exception)
			{
			}

			return Constants.SUCCESS;
		}
示例#5
0
 public LogLine(EVerbosityLevel InVerbosity, ELogColour InColour, string InLine)
 {
     Verbosity = InVerbosity;
     Colour    = InColour;
     Line      = InLine;
 }
示例#6
0
        ///////////////////////////////////////////////////////////////////////////

        /*
         * Logs a line of text to the agent log window
         */
        public Int32 Log(EVerbosityLevel Verbosity, ELogColour TextColour, string Line)
        {
            AgentApplication.Log(Verbosity, TextColour, Line);
            return(Constants.SUCCESS);
        }