Example #1
0
        static void Main(string[] args)
        {
            TryWritePid();
            TrooService.SetInfo(TrooService.ServiceInfo);
            if (!TrooService.ProcessCommandLineArgs(args))
            {
                IsolateMethodCalls = false;
                AddSwitches(typeof(UtilityActions));
                AddConfigurationSwitches();
                ArgumentAdder.AddArguments(args);

                Initialize(args, (a) =>
                {
                    OutLineFormat("Error parsing arguments: {0}", ConsoleColor.Red, a.Message);
                    Environment.Exit(1);
                });

                if (Arguments.Length > 0 && !Arguments.Contains("i"))
                {
                    ExecuteSwitches(Arguments, typeof(UtilityActions), false, Log.Default);
                }
                else if (Arguments.Contains("i"))
                {
                    Interactive();
                }
                else
                {
                    TrooService.RunService <TrooService>();
                }
            }
        }
Example #2
0
 private static ILogger GetLogger()
 {
     return(ServiceConfig.GetMultiTargetLogger(TrooService.CreateLog(TrooService.ServiceInfo.ServiceName)));
 }