Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ObjectMother.Current.GetName();
            var actorId = new Microsoft.ServiceFabric.Actors.ActorId("xxx");
            IConsoleRunnerLogger logger = new ConsoleRunnerLogger(Process.GetCurrentProcess().Id, Environment.MachineName, actorId);
            var consoleRunner           = new ConsoleRunner(logger)
            {
                Process = Process.GetCurrentProcess(), Name = ObjectMother.Current.GetName()
            };

            consoleRunner.Run();
        }
Ejemplo n.º 2
0
 public void WaitingForKeyPress(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId)
 {
     if (this.IsEnabled())
     {
         WaitingForKeyPress(
             processId,
             Environment.MachineName,
             actorId.ToString());
     }
 }
Ejemplo n.º 3
0
 public void RunnerDestroyed(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId)
 {
     if (this.IsEnabled())
     {
         RunnerDestroyed(
             processId,
             Environment.MachineName,
             actorId.ToString());
     }
 }
Ejemplo n.º 4
0
 public void StartLoop(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId)
 {
     if (this.IsEnabled())
     {
         StartLoop(
             processId,
             Environment.MachineName,
             actorId.ToString());
     }
 }
Ejemplo n.º 5
0
        public ConsoleRunnerLogger(
            int processId,
            string machineName,
            Microsoft.ServiceFabric.Actors.ActorId actorId)
        {
            _processId   = processId;
            _machineName = machineName;
            _actorId     = actorId;

            _telemetryClient = new Microsoft.ApplicationInsights.TelemetryClient();
            _telemetryClient.Context.User.Id                = Environment.UserName;
            _telemetryClient.Context.Session.Id             = Guid.NewGuid().ToString();
            _telemetryClient.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
        }
Ejemplo n.º 6
0
 public void StopHello(
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     int processId,
     string machineName)
 {
     if (this.IsEnabled())
     {
         StopHello(
             actorId.ToString(),
             actorId.Kind.ToString(),
             processId,
             Environment.MachineName);
     }
 }
Ejemplo n.º 7
0
 public void RandomIntsGenerated(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     int[] values)
 {
     if (this.IsEnabled())
     {
         RandomIntsGenerated(
             processId,
             Environment.MachineName,
             actorId.ToString(),
             values.ToString());
     }
 }
Ejemplo n.º 8
0
 public void KeyPressed(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     System.ConsoleKey key)
 {
     if (this.IsEnabled())
     {
         KeyPressed(
             processId,
             Environment.MachineName,
             actorId.ToString(),
             key.ToString());
     }
 }
Ejemplo n.º 9
0
 public void Specially(
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     int processId,
     string machineName,
     ConsoleApplication1.Loggers.Special special)
 {
     if (this.IsEnabled())
     {
         Specially(
             actorId.ToString(),
             actorId.Kind.ToString(),
             processId,
             Environment.MachineName,
             special.ToString());
     }
 }
Ejemplo n.º 10
0
 public void UnsupportedKeyError(
     int processId,
     string machineName,
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         UnsupportedKeyError(
             processId,
             Environment.MachineName,
             actorId.ToString(),
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
Ejemplo n.º 11
0
 public void SayGoodbye(
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     int processId,
     string machineName,
     string goodbye,
     System.DateTime nightTime)
 {
     if (this.IsEnabled())
     {
         SayGoodbye(
             actorId.ToString(),
             actorId.Kind.ToString(),
             processId,
             Environment.MachineName,
             goodbye,
             nightTime.ToString());
     }
 }
Ejemplo n.º 12
0
 public void Error(
     Microsoft.ServiceFabric.Actors.ActorId actorId,
     int processId,
     string machineName,
     System.Exception exception)
 {
     if (this.IsEnabled())
     {
         Error(
             actorId.ToString(),
             actorId.Kind.ToString(),
             processId,
             Environment.MachineName,
             exception.Message,
             exception.Source,
             exception.GetType().FullName,
             exception.AsJson());
     }
 }