private void SubCallback(string key, MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs args)
    {
        log.Information("subscription callback {0}", key);

        MonitoredItemNotification notification = args.NotificationValue as MonitoredItemNotification;

        if (notification != null)
        {
            DataQueryResponse response = new DataQueryResponse {
            };
            log.Information("subscription callback {0}", notification.Value);
            QueryResult queryResult = new QueryResult();
            queryResult.RefId = key;
            var jsonResults = JsonSerializer.Serialize <DataValue>(notification.Value);
            queryResult.MetaJson = jsonResults;
        }
    }
Пример #2
0
    public void Marcar(int Codigo, string token)
    {
        var envReader = new EnvReader();

        var         client  = new RestClient(envReader.GetStringValue("API"));
        RestRequest request = new  RestRequest($@"/sync/{Codigo}", Method.PUT);

        request.AddHeader("auth", token);

        var resposta = client.Execute(request);

        if (resposta.StatusCode != System.Net.HttpStatusCode.Created && resposta.StatusCode != System.Net.HttpStatusCode.OK)
        {
            log.Error("Não confirmei a sincronização!!! ");
            log.Error(resposta.Content);
            throw new Exception(resposta.Content);
        }

        log.Information("Fiz a marcação de sucesso da sincronização.");
    }
Пример #3
0
 public static void Info(string format, params object[] ps) => _log.Information(format, ps);
Пример #4
0
 public static void ReInit()
 {
     Log.Information("Reinit backend now...");
     Backend.Init(true);
 }
Пример #5
0
 // Update is called once per frame
 void Update()
 {
     _logger.Information("call update");
 }