Exemplo n.º 1
0
        public void LogRubberduckStart()
        {
            var version = _version.CurrentVersion;

            GlobalDiagnosticsContext.Set("RubberduckVersion", version.ToString());

            var headers = new List <string>
            {
                $"\r\n\tRubberduck version {version} loading:",
                $"\tOperating System: {Environment.OSVersion.VersionString} {(Environment.Is64BitOperatingSystem ? "x64" : "x86")}"
            };

            try
            {
                headers.AddRange(new []
                {
                    $"\tHost Product: {Application.ProductName} {(Environment.Is64BitProcess ? "x64" : "x86")}",
                    $"\tHost Version: {Application.ProductVersion}",
                    $"\tHost Executable: {_filesystem.Path.GetFileName(Application.ExecutablePath).ToUpper()}", // .ToUpper() used to convert ExceL.EXE -> EXCEL.EXE
                });
            }
            catch
            {
                headers.Add("\tHost could not be determined.");
            }

            LogLevelHelper.SetDebugInfo(string.Join(Environment.NewLine, headers));
        }
Exemplo n.º 2
0
        public void LogRubberduckStart()
        {
            var version = _version.CurrentVersion;

            GlobalDiagnosticsContext.Set("RubberduckVersion", version.ToString());
            var headers = new List <string>
            {
                string.Format("\r\n\tRubberduck version {0} loading:", version),
                string.Format("\tOperating System: {0} {1}", Environment.OSVersion.VersionString, Environment.Is64BitOperatingSystem ? "x64" : "x86"),
                string.Format("\tHost Product: {0} {1}", Application.ProductName, Environment.Is64BitProcess ? "x64" : "x86"),
                string.Format("\tHost Version: {0}", Application.ProductVersion),
                string.Format("\tHost Executable: {0}", Path.GetFileName(Application.ExecutablePath)),
            };

            LogLevelHelper.SetDebugInfo(string.Join(Environment.NewLine, headers));
        }