SetDefaultClientLogFile() public static method

Set the default location of the SebClientLogFileDirectory.
public static SetDefaultClientLogFile ( ) : void
return void
        public static void InitializeLogger()
        {
            if (!(bool)SEBClientInfo.getSebSetting("enableLogging")["enableLogging"])
            {
                return;
            }
            string name = (string)SEBSettings.valueForDictionaryKey(SEBSettings.settingsCurrent, "logDirectoryWin");

            if (!string.IsNullOrEmpty(name))
            {
                SEBClientInfo.SebClientLogFileDirectory = Environment.ExpandEnvironmentVariables(name);
                SEBClientInfo.SebClientLogFile          = string.Format("{0}\\{1}", (object)SEBClientInfo.SebClientLogFileDirectory, (object)"SebClient.log");
            }
            else
            {
                SEBClientInfo.SetDefaultClientLogFile();
            }
            Logger.InitLogger(SEBClientInfo.SebClientLogFileDirectory, (string)null);
        }
        public static void SetSebPaths()
        {
            SEBClientInfo.ApplicationExecutableDirectory = Path.GetDirectoryName(Application.ExecutablePath);
            SEBClientInfo.ProgramFilesX86Directory       = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
            string folderPath1 = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            string folderPath2 = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            SEBClientInfo.SebClientSettingsProgramDataDirectory = new StringBuilder(folderPath1).Append("\\").Append("SafeExamBrowser").Append("\\").ToString();
            SEBClientInfo.SebClientSettingsAppDataDirectory     = new StringBuilder(folderPath2).Append("\\").Append("SafeExamBrowser").Append("\\").ToString();
            SEBClientInfo.SebClientDirectory  = new StringBuilder(SEBClientInfo.ProgramFilesX86Directory).Append("\\").Append("SafeExamBrowser").Append("\\").ToString();
            SEBClientInfo.XulRunnerDirectory  = new StringBuilder("SebWindowsBrowser").Append("\\").Append("xulrunner").Append("\\").ToString();
            SEBClientInfo.XulSebDirectory     = new StringBuilder("SebWindowsBrowser").Append("\\").Append("xul_seb").Append("\\").ToString();
            SEBClientInfo.XulRunnerExePath    = new StringBuilder(SEBClientInfo.XulRunnerDirectory).Append("xulrunner.exe").ToString();
            SEBClientInfo.XulRunnerSebIniPath = new StringBuilder(SEBClientInfo.XulSebDirectory).Append("seb.ini").ToString();
            SEBClientInfo.SebClientSettingsProgramDataFile = new StringBuilder(SEBClientInfo.SebClientSettingsProgramDataDirectory).Append("SebClientSettings.seb").ToString();
            SEBClientInfo.SebClientSettingsAppDataFile     = new StringBuilder(SEBClientInfo.SebClientSettingsAppDataDirectory).Append("SebClientSettings.seb").ToString();
            SEBClientInfo.SebResourceDirectory             = new StringBuilder(SEBClientInfo.ApplicationExecutableDirectory).Append("\\").Append("SebWindowsResources").Append("\\").ToString();
            SEBClientInfo.SetDefaultClientLogFile();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialise Logger if it's enabled.
        /// </summary>
        public static void InitializeLogger()
        {
            if ((Boolean)getSebSetting(SEBSettings.KeyEnableLogging)[SEBSettings.KeyEnableLogging])
            {
                string logDirectory = (string)SEBSettings.valueForDictionaryKey(SEBSettings.settingsCurrent, SEBSettings.KeyLogDirectoryWin);
                if (!String.IsNullOrEmpty(logDirectory))
                {
                    // Expand environment variables in log file path
                    SebClientLogFileDirectory = Environment.ExpandEnvironmentVariables(logDirectory);

                    SebClientLogFile = String.Format(@"{0}\{1}", SebClientLogFileDirectory, SEB_CLIENT_LOG);
                }
                else
                {
                    SEBClientInfo.SetDefaultClientLogFile();
                }
                Logger.InitLogger(SEBClientInfo.SebClientLogFileDirectory, null);
            }
        }