Exemple #1
0
 //--- Constructors ---
 public RollbarClient(RollbarConfiguration configuration, IPayloadBuilder payloadBuilder)
 {
     _configuration  = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _payloadBuilder = payloadBuilder ?? throw new ArgumentNullException(nameof(payloadBuilder));
     _encoding       = Encoding.GetEncoding(_configuration.Encoding);
     if (!string.IsNullOrWhiteSpace(_configuration.Proxy))
     {
         _proxy = new WebProxy(_configuration.Proxy);
     }
 }
Exemple #2
0
        //--- Class Methods ---
        public static IRollbarClient Create(RollbarConfiguration configuration)
        {
            var frame      = new FrameCollectionBuilder();
            var exception  = new ExceptionInfoBuilder();
            var trace      = new TraceBuilder(exception, frame);
            var traceChain = new TraceChainBuilder(trace);
            var body       = new BodyBuilder(trace, traceChain);
            var title      = new TitleBuilder();
            var data       = new DataBuilder(configuration, body, title);

            return(new RollbarClient(configuration, new PayloadBuilder(configuration, data)));
        }