Exemple #1
0
        public static void Initialize(Guid sessionId, ElasticConfig config = null)
        {
            try
            {
                if (config == null)
                {
                    config = DefaultConfig();
                }

                elasticSearchDelivery = new LogDelivery(config);

                ElasticLogManager.sessionId = sessionId;

                CreateSession(true);
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                Dispose();
            }

            Application.quitting += Dispose;
            Application.logMessageReceivedThreaded += LogCallback;
            isInitialized = true;
        }
Exemple #2
0
        public LogDelivery(ElasticConfig elasticConfig)
        {
            _elasticConfig = elasticConfig;

            if (_elasticConfig.transformer == null)
            {
                _elasticConfig.transformer = DefaultTransformer;
            }

            cancellationTokenSource = new CancellationTokenSource();

            ESCallerService.Setup(_elasticConfig);

#if DEBUG
            includeLogs = true;
#endif

            Task.Run(CheckLogs, cancellationTokenSource.Token);
        }
 public static void Setup(ElasticConfig config)
 {
     instance        = new ESCallerService();
     instance.caller = new UnityCaller();
     instance.caller.Setup(new Uri(config.address), new BasicAuthentication(config.user, config.password));
 }