Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RaygunClient" /> class.
        /// </summary>
        /// <param name="apiKey">The API key.</param>
        public RaygunClient(string apiKey)
        {
            _apiKey = apiKey;

            _fileManager = new RaygunFileManager();
            _fileManager.Intialise();

            MaxReportsStoredOnDevice = RaygunFileManager.MAX_STORED_REPORTS_UPPER_LIMIT;

            // Setting default user information.
            var anonUser = GetAnonymousUserInfo();

            _userInfo = anonUser;
            _user     = anonUser.Identifier;

            _wrapperExceptions.Add(typeof(TargetInvocationException));
            _wrapperExceptions.Add(typeof(AggregateException));

            try
            {
                var clientVersion = new AssemblyName(GetType().Assembly.FullName).Version.ToString();
                RaygunLogger.Info(string.Format("Configuring Raygun ({0})", clientVersion));
            }
            catch
            {
                // Ignore
            }
        }