-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
57 lines (49 loc) · 2.69 KB
/
Copy pathProgram.cs
File metadata and controls
57 lines (49 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Windows.Forms;
namespace WebToolsDataMonitor
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// 1. Initialize the global app config FIRST - Logger itself reads its settings from it, so
// this must be touched before anything (including the very first Logger.Instance call) below.
var appConfig = AppConfig.Instance;
// 2. Initialize the thread-safe Logger and write the bootstrap header
Logger.Instance.Info("BOOTSTRAP", "========================================================================");
Logger.Instance.Info("BOOTSTRAP", "APPLICATION SUBSYSTEM INITIALIZATION STARTED");
Logger.Instance.Info("BOOTSTRAP", "========================================================================");
try
{
// 3. Load the JavaScript assets repository first
Logger.Instance.Info("BOOTSTRAP", "Loading Scripts Repository cache...");
var scriptCache = ScriptsRepository.Instance;
// 4. Load the tool configurations and map their nested pages/scripts from the filesystem
Logger.Instance.Info("BOOTSTRAP", "Loading Tool Manifests & Page Mapping Matrices...");
var toolCache = ToolRepository.Instance;
Logger.Instance.Info("BOOTSTRAP", "========================================================================");
Logger.Instance.Info("BOOTSTRAP", "REPOSITORIES SEEDED SUCCESS. LAUNCHING WINDOWS FORMS SYSTEM ENVIRONMENT");
Logger.Instance.Info("BOOTSTRAP", "========================================================================");
// 5. Run the main visual dashboard application
Application.Run(new Form1());
}
catch (Exception ex)
{
// Catch any catastrophic configuration loading faults before the form renders
Logger.Instance.Critical("BOOTSTRAP", $"Application crashed during initial boot sequence! Error: {ex.Message}\nDetails: {ex.StackTrace}");
MessageBox.Show(
$"A critical failure occurred during application initialization.\nCheck 'scraper_execution.log' for details.\n\nError: {ex.Message}",
"Critical Startup Failure",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
}
}
}
}