예제 #1
0
파일: Program.cs 프로젝트: dbraillon/Aida
        static void Main(string[] args)
        {
#if Release
            // Initialize log system
            GRoggle.Use(
                new EventLogRoggle(
                    eventSourceName: AidaApplicationSourceName, eventLogName: AidaLogName,
                    acceptedLogLevels: RoggleLogLevel.Debug | RoggleLogLevel.Error | RoggleLogLevel.Info | RoggleLogLevel.Warning
                    )
                );
#endif

            // Start main application thread
            Aida = new AidaCore(
                voice: new FrenchFemaleVoice()
                );
            Aida.Start();

            // Set this thread idle, waiting for user input
            while (Aida.IsRunning)
            {
                var userInput = Console.ReadLine();

                switch (userInput)
                {
                case "exit":
                    Aida.Stop();
                    break;

                default:
                    Aida.Write(userInput);
                    break;
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: dbraillon/Aida
        static void Main(string[] args)
        {
            if (Environment.UserInteractive)
            {
                if (args.FirstOrDefault() == "-i")
                {
                    Install();
                }
                if (args.FirstOrDefault() == "-u")
                {
                    Uninstall();
                }
                if (args.FirstOrDefault() == "-d")
                {
                    Debug();
                }
            }
            else
            {
                GRoggle.Use(
                    new EventLogRoggle(
                        eventSourceName: AidaServiceSourceName, eventLogName: AidaLogName,
                        acceptedLogLevels: RoggleLogLevel.Debug | RoggleLogLevel.Error | RoggleLogLevel.Info | RoggleLogLevel.Warning
                        )
                    );

                ServiceBase.Run(Services);
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: dbraillon/Aida
        static void Install()
        {
            // Create Roggle log
            GRoggle.Use(
                new EventLogRoggle(eventSourceName: AidaServiceSourceName, eventLogName: AidaLogName),
                new EventLogRoggle(eventSourceName: AidaApplicationSourceName, eventLogName: AidaLogName)
                );

            // Start installutil.exe to install services
            ManagedInstallerClass.InstallHelper(new string[] { Assembly.GetExecutingAssembly().Location });

            // Start services if necessary
            foreach (var service in Services)
            {
                ServiceController serviceController = new ServiceController(service.ServiceName);
                serviceController.Start();
            }
        }
예제 #4
0
파일: Program.cs 프로젝트: dbraillon/Roggle
        static void TestSentryRoggle(string dsn)
        {
            Console.Clear();
            Console.WriteLine("-------------");
            Console.WriteLine("Test a Roggle");
            Console.WriteLine("-------------");
            Console.WriteLine();

            try
            {
                GRoggle.Use(new SentryRoggle(dsn));
                GRoggle.Write("Test debug", RoggleLogLevel.Debug);
                GRoggle.Write("Test error very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very", RoggleLogLevel.Error);
                GRoggle.Write("Test info", RoggleLogLevel.Info);
                GRoggle.Write("Test warning", RoggleLogLevel.Warning);
            }
            catch (Exception)
            {
                Console.WriteLine("ERR");
                Console.WriteLine("Failed to test Sentry Roggle.");
            }
        }