public static int Main(string[] args)
 {
     if (s_projectId == "YOUR-PROJECT" + "-ID")
     {
         Console.WriteLine("Update Program.cs and replace YOUR-PROJECT" +
             "-ID with your project id, and recompile.");
         return -1;
     }
     LoggingSample loggingSample = new LoggingSample();
     return loggingSample.Run(args);
 }
Пример #2
0
        public static int Main(string[] args)
        {
            if (s_projectId == "YOUR-PROJECT" + "-ID")
            {
                Console.WriteLine("Update Program.cs and replace YOUR-PROJECT" +
                                  "-ID with your project id, and recompile.");
                return(-1);
            }
            LoggingSample loggingSample = new LoggingSample();

            return(loggingSample.Run(args));
        }
Пример #3
0
        /// <summary>Runs LoggingSample.exe with the provided arguments</summary>
        /// <returns>The console output of this program</returns>
        public static ConsoleOutput Run(params string[] arguments)
        {
            Console.Write("LoggingSample.exe ");
            Console.WriteLine(string.Join(" ", arguments));

            using (var output = new StringWriter())
            {
                LoggingSample loggingSample = new LoggingSample(output);
                var           consoleOutput = new ConsoleOutput()
                {
                    ExitCode = loggingSample.Run(arguments),
                    Stdout   = output.ToString()
                };
                Console.Write(consoleOutput.Stdout);
                return(consoleOutput);
            }
        }