Exemplo n.º 1
0
 public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args)
 {
     if (verbosity > Verbosity)
     {
         return;
     }
     lock (_lock)
     {
         try
         {
             var palette = _palettes[level];
             var tokens = FormatParser.Parse(format);
             foreach (var token in tokens)
             {
                 SetPalette(token, palette);
                 _console.Write("{0}", token.Render(args));
             }
         }
         finally
         {
             _console.ResetColor();
             _console.WriteLine();
         }
     }
 }
Exemplo n.º 2
0
 public static string CreateUser(Geocode geocode, bool debugEnabled, Verbosity verbosity, List<string> fields)
 {
     var url = new Url(UserServiceBase);
     url.Append("create");
     HandleDefaults(url, geocode, debugEnabled, verbosity, fields);
     return url.ToString();
 }
Exemplo n.º 3
0
Arquivo: Log.cs Projeto: Khazuar/BOS
        public static void WriteInfo(Verbosity vLevel, string message)
        {
            if(vLevel < verbosityLevel)
                return;

            infoLog.WriteLine(DateTime.Now + ":" + message);
        }
Exemplo n.º 4
0
Arquivo: Log.cs Projeto: Khazuar/BOS
 public static void Init(Verbosity verbosity, TextWriter ilog, TextWriter glog, TextWriter elog)
 {
     verbosityLevel = verbosity;
     infoLog = ilog;
     gameLog = glog;
     errorLog = elog;
 }
Exemplo n.º 5
0
 public CakeBuildLog(IConsole console, Verbosity verbosity = Verbosity.Normal)
 {
     _console = console;
     _lock = new object();
     _palettes = CreatePalette();
     Verbosity = verbosity;
 }
 public Logger(string filename, Verbosity? verbosity = null)
     : this(verbosity)
 {
     if (!Attach(filename)) {
         Debug("Failed to open file '{0}' for logging (+a).", filename);
     }
 }
Exemplo n.º 7
0
 internal void SetStatusText( Verbosity verbosity, string text )
 {
     StatusUpdate del = delegate
     {
         this.toolStripStatusLabel1.Text = text;
         switch( verbosity )
         {
             case Verbosity.Critical:
                 this.toolStripStatusLabel1.ForeColor = Color.Red;
                 break;
             default:
             case Verbosity.Normal:
                 this.toolStripStatusLabel1.ForeColor = SystemColors.ControlText;
                 break;
             case Verbosity.Verbose:
                 this.toolStripStatusLabel1.ForeColor = Color.Green;
                 break;
             case Verbosity.Everything:
                 this.toolStripStatusLabel1.ForeColor = Color.Blue;
                 break;
         }
     };
     if( this.InvokeRequired == true )
         this.Invoke( del, verbosity, text );
     else
         del( verbosity, text );
 }
Exemplo n.º 8
0
 public static void Log(Verbosity verbosity,string format, params object[] arg0)
 {
     if ((int)verbosity >= (int)CurrentVerbosity)
     {
         Console.WriteLine(String.Format("{0}: ", verbosity.ToString()) + format, arg0);
     }
 }
Exemplo n.º 9
0
 public void WriteLine(Verbosity verbosity, string format, params object[] args)
 {
     if (Console.KeyAvailable)
     {
         var ki = Console.ReadKey(true);
         switch (ki.Key)
         {
             case ConsoleKey.D0:
             case ConsoleKey.D1:
             case ConsoleKey.D2:
             case ConsoleKey.D3:
             case ConsoleKey.D4:
             case ConsoleKey.D5:
                 var nv = (Verbosity)(ki.Key - ConsoleKey.D0);
                 Verbosity = nv;
                 Console.Clear();
                 break;
             default:
                 break;
         }
     }
     if (Verbosity >= verbosity)
         Console.WriteLine(String.Format(String.Format("{0}: ", verbosity) + format, args));
     if (LogfileVerbosity >= verbosity)
         WriteLogFile(String.Format(String.Format("{0}: ", verbosity) + format, args), false);
 }
Exemplo n.º 10
0
 public LogEntry(string message, Verbosity verbosity = Verbosity.Info)
     : this()
 {
     VerbosityLevel = verbosity;
     Timestamp = DateTime.Now;
     Message = message ?? string.Empty;
 }
Exemplo n.º 11
0
 public static void Log(Verbosity verbosity, string value)
 {
     if ((int)verbosity >= (int)CurrentVerbosity)
     {
         Console.WriteLine("{0}: {1}", verbosity.ToString(), value);
     }
 }
Exemplo n.º 12
0
 public static string CreateArticle(string type, Geocode geocode, bool debugEnabled, Verbosity verbosity, List<string> fields)
 {
     var url = new Url(ArticleServiceBase);
     url.Append(type);
     HandleDefaults(url, geocode, debugEnabled, verbosity, fields);
     return url.ToString();
 }
Exemplo n.º 13
0
 public void LogMessage(string message, Severity severity, Verbosity verbosity)
 {
     foreach (ILogWriter logWriter in this.writers)
     {
         logWriter.Log(severity, verbosity, message);
     }
 }
 public Logger(Stream stream, Verbosity? verbosity = null)
     : this(verbosity)
 {
     if (!Attach(stream)) {
             Debug("Failed to attach stream for logging.");
         }
 }
Exemplo n.º 15
0
 public static string UpdateArticle(string type, string id, int revision, Geocode geocode, bool enableDebug, Verbosity verbosity, List<string> fields)
 {
     var url = new Url(ArticleServiceBase).Append(type).Append(id);
     if (revision > 0)
         url.QueryString["revision"] = revision.ToString();
     HandleDefaults(url, geocode, enableDebug, verbosity, fields);
     return url.ToString();
 }
Exemplo n.º 16
0
 public static string DeleteArticle(string type, string id, bool deleteConnections, Geocode location, bool enableDebug, Verbosity verbosity, List<string> fields)
 {
     var url = new Url(ArticleServiceBase).Append(type).Append(id);
     if (deleteConnections == true)
         url.QueryString["deleteconnections"] = "true";
     HandleDefaults(url, location, enableDebug, verbosity, fields);
     return url.ToString();
 }
Exemplo n.º 17
0
 public static void WriteLine(string value = null, Verbosity? minimumVerbosity = null)
 {
     if (minimumVerbosity == null || _verbosity >= minimumVerbosity)
     {
         _hasWritten = true;
         System.Console.WriteLine(value);
     }
 }
 protected ApiRequest(string sessionToken, Environment environment, string userToken = null, Geocode location = null, bool enableDebugging = false, Verbosity verbosity = Verbosity.Info)
 {
     this.SessionToken = sessionToken;
     this.CurrentLocation = location;
     this.Verbosity = verbosity;
     this.UserToken = userToken;
     this.Environment = environment;
     this.Fields = new List<string>();
 }
Exemplo n.º 19
0
 public void WriteLine( Verbosity verbosity, Feature feature, string value )
 {
     // if log to vs
     if( false )
     {
         Debug.WriteLine( string.Format( "{0}: {1}", feature, value ) );
     }
     this.logControl.AddLine( verbosity, feature, value );
 }
 public UpdateUserRequest(string sessionToken, Environment environment, string userToken = null, Geocode location = null, bool enableDebugging = false, Verbosity verbosity = Verbosity.Info) :
     base(sessionToken, environment, userToken, location, enableDebugging, verbosity)
 {
     this.PropertyUpdates = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
     this.AttributeUpdates = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
     this.AddedTags = new List<string>();
     this.RemovedTags = new List<string>();
     this.Revision = 0;
 }
Exemplo n.º 21
0
 public RunnerBase(Verbosity verbosity, Formats formats, TextWriter writer, CancellationToken cancellationToken, Progress<Indicator> progress, SemaphoreSlim semaphore)
 {
     this.verbosity = verbosity;
     this.formats = formats;
     this.cancellationToken = cancellationToken;
     this.writer = writer;
     this.progress = progress;
     this.handler = new EventHandler<Indicator>((_, v) => WriteProgress(v));
     this.semaphore = semaphore;
 }
Exemplo n.º 22
0
 /// <inheritdoc />
 public void Log(Severity severity, Verbosity verbosity, string content)
 {
     if (severity >= this.logSeverity && verbosity <= this.logVerbosity)
     {
         string msg = string.Format(CultureInfo.InvariantCulture, "Severity: {0}\r\n{1}", severity, content);
         lock (this.lockObject)
         {
             this.Write(msg);
         }
     }
 }
Exemplo n.º 23
0
        public RollingFileLogSink(IRollingFileSettings settings, IRollingFileManager logWriterManager = null, ILogEntryFormatter formatter = null, Verbosity verbosity = Verbosity.All)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            _settings = settings;
            _formatter = formatter ?? new LogEntryFormatter();
            _logWriterManager = logWriterManager ?? new RollingFileManager(settings, new LogFolder(settings.BasePath, settings.BaseFileName));

            _verbosity = verbosity;
        }
Exemplo n.º 24
0
 public void Message(string msg, Verbosity severity)
 {
     if ((severity & _logMask) != 0)
     {
         WriteMessage(msg);
     }
     if (_next != null)
     {
         _next.Message(msg, severity);
     }
 }
Exemplo n.º 25
0
 public static void log(string message, Verbosity level)
 {
     if(Logger.loudness == Verbosity.silent)
     {
         return;
     }
     if(level <= Logger.loudness)
     {
         System.Console.WriteLine(message);
     }
 }
Exemplo n.º 26
0
        private static void StartServer(string solutionPath, string clientPathMode, int port, Verbosity verbosity)
        {
            var logger = new Logger(verbosity);
            try
            {
                Configuration.ConfigurationLoader.Load(clientPathMode);

                ISolution solution;
                if(Directory.Exists(solutionPath))
                {
                    solution = new CSharpFolder(logger);
                }
                else
                {
                    solution = new CSharpSolution(logger);
                }

                Console.CancelKeyPress +=
                    (sender, e) =>
                        {
                            solution.Terminate();
                            Console.WriteLine("Ctrl-C pressed");
                            e.Cancel = true;
                        };
                var nancyHost = new NancyHost(new Bootstrapper(
                                                solution,
                                                new NativeFileSystem(),
                                                logger),
                                                new HostConfiguration{RewriteLocalhost=false},
                                                new Uri("http://localhost:" + port));

                nancyHost.Start();
                logger.Debug("OmniSharp server is listening");
                solution.LoadSolution(solutionPath.ApplyPathReplacementsForServer());
                logger.Debug("Solution has finished loading");
                while (!solution.Terminated)
                {
                    Thread.Sleep(1000);
                }

                Console.WriteLine("Quit gracefully");
                nancyHost.Stop();
            }
            catch(Exception e)
            {
                if(e is SocketException || e is HttpListenerException)
                {
                    logger.Error("Detected an OmniSharp instance already running on port " + port + ". Press a key.");
                    Console.ReadKey();
                    return;
                }
                throw;
            }
        }
Exemplo n.º 27
0
 protected ApiRequest(string apiKey, string sessionToken, Environment environment, string userToken = null, Geocode location = null, bool enableDebugging = false, Verbosity verbosity = Verbosity.Info)
 {
     this.ApiKey = apiKey;
     this.UseApiSession = string.IsNullOrWhiteSpace(sessionToken) ? false : true;
     this.SessionToken = sessionToken;
     this.CurrentLocation = location;
     this.Verbosity = verbosity;
     this.UserToken = userToken;
     this.Environment = environment;
     this.Fields = new List<string>();
 }
Exemplo n.º 28
0
        private static void WriteConsole(string message, ConsoleColor consoleColor, Verbosity minVerbosity = Verbosity.Normal)
        {
            if (Verbosity < minVerbosity)
            {
                return;
            }

            var oldColor = Console.ForegroundColor;
            Console.ForegroundColor = consoleColor;
            Console.WriteLine(message);
            Console.ForegroundColor = oldColor;
        }
Exemplo n.º 29
0
 public void ChangeVerbosityThreshold(Verbosity newLevel)
 {
     Lock.EnterWriteLock();
     try
     {
         Verbosity = newLevel;
     }
     finally
     {
         Lock.ExitWriteLock();
     }
 }
Exemplo n.º 30
0
        /// <summary>
        /// Writes the text representation of the specified array of objects to the 
        /// log using the specified verbosity, log level and format information.
        /// </summary>
        /// <param name="verbosity">The verbosity.</param>
        /// <param name="level">The log level.</param>
        /// <param name="format">A composite format string.</param>
        /// <param name="args">An array of objects to write using format.</param>
        public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args)
        {
            try
            {
                if (DebugLog.Lines == null)
                {
                    DebugLog.Lines = new List<string>();
                }

                DebugLog.Lines.Add(format);
                Debug.WriteLine(format);
            }
            catch { }
        }
Exemplo n.º 31
0
        private static int Main(string[] args)
        {
            WriteLine($"Roslynator Command Line Tool version {typeof(Program).GetTypeInfo().Assembly.GetName().Version}", Verbosity.Quiet);
            WriteLine("Copyright (c) Josef Pihrt. All rights reserved.", Verbosity.Quiet);
            WriteLine(Verbosity.Quiet);

            try
            {
                ParserResult <object> parserResult = Parser.Default.ParseArguments <
                    MigrateCommandLineOptions,
#if DEBUG
                    AnalyzeAssemblyCommandLineOptions,
                    FindSymbolsCommandLineOptions,
                    SlnListCommandLineOptions,
                    ListVisualStudioCommandLineOptions,
                    GenerateSourceReferencesCommandLineOptions,
                    ListReferencesCommandLineOptions,
#endif
                    FixCommandLineOptions,
                    AnalyzeCommandLineOptions,
                    ListSymbolsCommandLineOptions,
                    FormatCommandLineOptions,
                    PhysicalLinesOfCodeCommandLineOptions,
                    LogicalLinesOfCodeCommandLineOptions,
                    GenerateDocCommandLineOptions,
                    GenerateDocRootCommandLineOptions
                    >(args);

                var verbosityParsed = false;

                parserResult.WithParsed <AbstractCommandLineOptions>(options =>
                {
                    var defaultVerbosity = Verbosity.Normal;

                    if (options.Verbosity == null ||
                        TryParseVerbosity(options.Verbosity, out defaultVerbosity))
                    {
                        ConsoleOut.Verbosity = defaultVerbosity;

                        Verbosity fileLogVerbosity = defaultVerbosity;

                        if (options.FileLogVerbosity == null ||
                            TryParseVerbosity(options.FileLogVerbosity, out fileLogVerbosity))
                        {
                            if (options.FileLog != null)
                            {
                                var fs = new FileStream(options.FileLog, FileMode.Create, FileAccess.Write, FileShare.Read);
                                var sw = new StreamWriter(fs, Encoding.UTF8, bufferSize: 4096, leaveOpen: false);
                                Out    = new TextWriterWithVerbosity(sw)
                                {
                                    Verbosity = fileLogVerbosity
                                };
                            }

                            verbosityParsed = true;
                        }
                    }
                });

                if (!verbosityParsed)
                {
                    return(1);
                }

                return(parserResult.MapResult(
#if DEBUG
                           (AnalyzeAssemblyCommandLineOptions options) => AnalyzeAssembly(options),
                           (FindSymbolsCommandLineOptions options) => FindSymbolsAsync(options).Result,
                           (SlnListCommandLineOptions options) => SlnListAsync(options).Result,
                           (ListVisualStudioCommandLineOptions options) => ListVisualStudio(options),
                           (GenerateSourceReferencesCommandLineOptions options) => GenerateSourceReferencesAsync(options).Result,
                           (ListReferencesCommandLineOptions options) => ListReferencesAsync(options).Result,
#endif
                           (FixCommandLineOptions options) => FixAsync(options).Result,
                           (AnalyzeCommandLineOptions options) => AnalyzeAsync(options).Result,
                           (ListSymbolsCommandLineOptions options) => ListSymbolsAsync(options).Result,
                           (FormatCommandLineOptions options) => FormatAsync(options).Result,
                           (PhysicalLinesOfCodeCommandLineOptions options) => PhysicalLinesOfCodeAsync(options).Result,
                           (LogicalLinesOfCodeCommandLineOptions options) => LogicalLinesOrCodeAsync(options).Result,
                           (GenerateDocCommandLineOptions options) => GenerateDocAsync(options).Result,
                           (GenerateDocRootCommandLineOptions options) => GenerateDocRootAsync(options).Result,
                           (MigrateCommandLineOptions options) => Migrate(options),
                           _ => 1));
            }
            catch (Exception ex)
            {
                if (ex is AggregateException aggregateException)
                {
                    foreach (Exception innerException in aggregateException.InnerExceptions)
                    {
                        WriteError(innerException);
                    }
                }
                else if (ex is FileNotFoundException ||
                         ex is InvalidOperationException)
                {
                    WriteError(ex);
                }
                else
                {
                    throw;
                }
            }
            finally
            {
                Out?.Dispose();
                Out = null;
            }

            return(1);
        }
Exemplo n.º 32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NpmRunner" /> class.
 /// </summary>
 /// <param name="fileSystem">The file system</param>
 /// <param name="environment">The environment</param>
 /// <param name="processRunner">The process runner</param>
 /// <param name="toolLocator">The tool locator</param>
 /// <param name="cakeVerbosityLevel">Specifies the current Cake verbosity level</param>
 internal NpmRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator toolLocator, Verbosity cakeVerbosityLevel = Verbosity.Normal) : base(fileSystem, environment, processRunner, toolLocator)
 {
     _fileSystem         = fileSystem;
     _cakeVerbosityLevel = cakeVerbosityLevel;
 }
Exemplo n.º 33
0
 /// <summary>
 /// Writes a warning message to the log using the specified verbosity and format information.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="format">A composite format string.</param>
 /// <param name="args">An array of objects to write using format.</param>
 public static void Warning(this ICakeLog log, Verbosity verbosity, string format, params object[] args)
 {
     log?.Write(verbosity, LogLevel.Warning, format, args);
 }
Exemplo n.º 34
0
 public static bool TryMap(string value, out Verbosity verbosity) => map.TryGetValue(value, out verbosity);
Exemplo n.º 35
0
        protected bool BuildInternal(string projectOrSolution, string target, string [] parameters = null, Dictionary <string, string> environmentVariables = null)
        {
            buildLogFullPath = (!string.IsNullOrEmpty(BuildLogFile))
                                ? Path.GetFullPath(Path.Combine(Root, Path.GetDirectoryName(projectOrSolution), BuildLogFile))
                                : null;
            string processLog = !string.IsNullOrEmpty(BuildLogFile)
                                ? Path.Combine(Path.GetDirectoryName(buildLogFullPath), "process.log")
                                : null;

            var logger = buildLogFullPath == null
                                ? string.Empty
                                : string.Format("/noconsolelogger \"/flp1:LogFile={0};Encoding=UTF-8;Verbosity={1}\"",
                                                buildLogFullPath, Verbosity.ToString().ToLower());

            var start              = DateTime.UtcNow;
            var homeDirectory      = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var androidSdkToolPath = Path.Combine(homeDirectory, "android-toolchain");
            var sdkPath            = Environment.GetEnvironmentVariable("ANDROID_SDK_PATH");

            if (String.IsNullOrEmpty(sdkPath))
            {
                sdkPath = GetPathFromRegistry("AndroidSdkDirectory");
            }
            if (String.IsNullOrEmpty(sdkPath))
            {
                sdkPath = Path.GetFullPath(Path.Combine(androidSdkToolPath, "sdk"));
            }
            var ndkPath = Environment.GetEnvironmentVariable("ANDROID_NDK_PATH");

            if (String.IsNullOrEmpty(ndkPath))
            {
                ndkPath = GetPathFromRegistry("AndroidNdkDirectory");
            }
            if (String.IsNullOrEmpty(ndkPath))
            {
                ndkPath = Path.GetFullPath(Path.Combine(androidSdkToolPath, "ndk"));
            }

            var args = new StringBuilder();
            var psi  = new ProcessStartInfo(XABuildExe);

            args.AppendFormat("{0} /t:{1} {2}",
                              QuoteFileName(Path.Combine(Root, projectOrSolution)), target, logger);
            if (RunningMSBuild)
            {
                args.Append(" /p:BuildingOutOfProcess=true");
            }
            else
            {
                args.Append(" /p:UseHostCompilerIfAvailable=false /p:BuildingInsideVisualStudio=true");
            }
            if (Directory.Exists(sdkPath))
            {
                args.AppendFormat(" /p:AndroidSdkDirectory=\"{0}\" ", sdkPath);
            }
            if (Directory.Exists(ndkPath))
            {
                args.AppendFormat(" /p:AndroidNdkDirectory=\"{0}\" ", ndkPath);
            }
            if (parameters != null)
            {
                foreach (var param in parameters)
                {
                    args.AppendFormat(" /p:{0}", param);
                }
            }
            if (RunningMSBuild)
            {
                psi.EnvironmentVariables ["MSBUILD"] = "msbuild";
                args.Append($" /bl:\"{Path.GetFullPath (Path.Combine (Root, Path.GetDirectoryName (projectOrSolution), "msbuild.binlog"))}\"");
            }
            if (environmentVariables != null)
            {
                foreach (var kvp in environmentVariables)
                {
                    psi.EnvironmentVariables [kvp.Key] = kvp.Value;
                }
            }
            //NOTE: fix for Jenkins, see https://github.com/xamarin/xamarin-android/pull/1049#issuecomment-347625456
            psi.EnvironmentVariables ["ghprbPullLongDescription"] = "";

            psi.Arguments = args.ToString();

            psi.CreateNoWindow         = true;
            psi.UseShellExecute        = false;
            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError  = true;
            psi.StandardErrorEncoding  = Encoding.UTF8;
            psi.StandardOutputEncoding = Encoding.UTF8;

            bool             nativeCrashDetected = false;
            bool             result          = false;
            bool             ranToCompletion = false;
            int              attempts        = 1;
            ManualResetEvent err             = new ManualResetEvent(false);
            ManualResetEvent stdout          = new ManualResetEvent(false);

            for (int attempt = 0; attempt < attempts; attempt++)
            {
                if (processLog != null)
                {
                    File.AppendAllText(processLog, psi.FileName + " " + args.ToString() + Environment.NewLine);
                }
                using (var p = new Process()) {
                    p.ErrorDataReceived += (sender, e) => {
                        if (e.Data != null && !string.IsNullOrEmpty(processLog))
                        {
                            File.AppendAllText(processLog, e.Data + Environment.NewLine);
                            if (e.Data.StartsWith(SigSegvError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                            if (e.Data.StartsWith(ConsoleLoggerError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                        }
                        if (e.Data == null)
                        {
                            err.Set();
                        }
                    };
                    p.OutputDataReceived += (sender, e) => {
                        if (e.Data != null && !string.IsNullOrEmpty(processLog))
                        {
                            File.AppendAllText(processLog, e.Data + Environment.NewLine);
                            if (e.Data.StartsWith(SigSegvError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                            if (e.Data.StartsWith(ConsoleLoggerError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                        }
                        if (e.Data == null)
                        {
                            stdout.Set();
                        }
                    };
                    p.StartInfo = psi;
                    p.Start();
                    p.BeginOutputReadLine();
                    p.BeginErrorReadLine();
                    ranToCompletion = p.WaitForExit((int)new TimeSpan(0, 10, 0).TotalMilliseconds);
                    if (psi.RedirectStandardOutput)
                    {
                        stdout.WaitOne();
                    }
                    if (psi.RedirectStandardError)
                    {
                        err.WaitOne();
                    }
                    result = ranToCompletion && p.ExitCode == 0;
                }

                LastBuildTime = DateTime.UtcNow - start;

                if (processLog != null && !ranToCompletion)
                {
                    File.AppendAllText(processLog, "Build Timed Out!");
                }
                if (buildLogFullPath != null && File.Exists(buildLogFullPath))
                {
                    foreach (var line in LastBuildOutput)
                    {
                        if (line.StartsWith("Time Elapsed", StringComparison.OrdinalIgnoreCase))
                        {
                            var match = timeElapsedRegEx.Match(line);
                            if (match.Success)
                            {
                                LastBuildTime = TimeSpan.Parse(match.Groups ["TimeSpan"].Value);
                                Console.WriteLine($"Found Time Elapsed {LastBuildTime}");
                            }
                        }
                    }
                }

                if (nativeCrashDetected)
                {
                    Console.WriteLine($"Native crash detected! Running the build for {projectOrSolution} again.");
                    if (attempt == 0)
                    {
                        File.Move(processLog, processLog + ".bak");
                    }
                    nativeCrashDetected = false;
                    continue;
                }
                else
                {
                    break;
                }
            }


            if (buildLogFullPath != null && processLog != null)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(buildLogFullPath));
                if (File.Exists(processLog))
                {
                    File.AppendAllText(buildLogFullPath, File.ReadAllText(processLog));
                }
            }
            if (!result && ThrowOnBuildFailure)
            {
                string message = "Build failure: " + Path.GetFileName(projectOrSolution) + (BuildLogFile != null && File.Exists(buildLogFullPath) ? "Build log recorded at " + buildLogFullPath : null);
                throw new FailedBuildException(message, null, File.ReadAllText(buildLogFullPath));
            }

            return(result);
        }
Exemplo n.º 36
0
 /// <summary>
 /// Initializes a new instance of the StreamWriterLogWriter class.
 /// </summary>
 /// <param name="writer">
 /// The stream writer into which log values should be written.
 /// </param>
 /// <param name="severity">
 /// The severity of messages that should be submitted to the log writer.
 /// The log writer will accept messages of equal or greater logical severity.
 /// </param>
 /// <param name="verbosity">
 /// The verbosity level of messages that should be submitted to the log writer.
 /// The log writer will accept messages of equal or greater logical verbosity.
 /// </param>
 public StreamWriterLogWriter(StreamWriter writer, Severity severity, Verbosity verbosity)
     : base(severity, verbosity)
 {
     this.writer = writer;
 }
Exemplo n.º 37
0
 public static bool TryParseVerbosity(string value, out Verbosity verbosity)
 {
     return(TryParseAsEnum(value, OptionNames.Verbosity, out verbosity, provider: OptionValueProviders.VerbosityProvider));
 }
Exemplo n.º 38
0
 static void ExtractConstant(ref Verbosity constant, int apiId)
 {
     constant = (Verbosity)GetConstantPtr(apiId).ToInt32();
 }
Exemplo n.º 39
0
 /// <summary>
 /// Writes a verbose message to the log using the specified verbosity and log message action.
 /// Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="logAction">The log action.</param>
 public static void Verbose(this ICakeLog log, Verbosity verbosity, LogAction logAction)
 {
     Write(log, verbosity, LogLevel.Verbose, logAction);
 }
Exemplo n.º 40
0
 public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args)
 {
     Messages.Add(new MessageWrapper(verbosity, level, format, args));
 }
Exemplo n.º 41
0
 public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args)
 {
     Verbosity = verbosity;
     Level     = level;
     Message   = string.Format(format, args);
 }
Exemplo n.º 42
0
 public Logger(Verbosity verbosity)
 {
     _verbosity = verbosity;
     _stopwatch = new Stopwatch();
     _stopwatch.Start();
 }
Exemplo n.º 43
0
    public static int Main(string [] args)
    {
        Uri       uri       = null;
        Verbosity verbosity = default;

        #pragma warning disable
        bool isRetry        = false;
        bool nonInteractive = false;
        #pragma warning restore

        for (int i = 0; i < args.Length; i++)
        {
            switch (args [i].ToLowerInvariant())
            {
            case "-uri":
                if (i < args.Length - 1)
                {
                    Uri.TryCreate(args [++i], UriKind.Absolute, out uri);
                }
                break;

            case "-verbosity":
                if (i < args.Length - 1)
                {
                    Enum.TryParse <Verbosity> (args [++i], true, out verbosity);
                }
                break;

            case "-isretry":
                isRetry = true;
                break;

            case "-noninteractive":
                nonInteractive = true;
                break;
            }
        }

        if (uri == null)
        {
            return(ProviderNotApplicable);
        }

        if (!uri.Host.EndsWith(".pkgs.visualstudio.com", StringComparison.OrdinalIgnoreCase))
        {
            return(ProviderNotApplicable);
        }

        var patDir = Path.Combine(
            Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
            "VSSPAT");

        var patPath = Path.Combine(patDir, uri.Host);

        // be nice and create the directory so the user
        // can simply echo the PAT directly to a file
        Directory.CreateDirectory(patDir);

        if (!File.Exists(patPath))
        {
            Console.WriteLine(new Response {
                Message = $"PAT file does not exist: {patPath}"
            });
            return(Failure);
        }

        Console.WriteLine(new Response {
            Username = "******",
            Password = File.ReadAllText(patPath).Trim()
        });

        return(Success);
    }
Exemplo n.º 44
0
        protected bool BuildInternal(string projectOrSolution, string target, string [] parameters = null, Dictionary <string, string> environmentVariables = null, bool restore = true)
        {
            buildLogFullPath = (!string.IsNullOrEmpty(BuildLogFile))
                                ? Path.GetFullPath(Path.Combine(XABuildPaths.TestOutputDirectory, Path.GetDirectoryName(projectOrSolution), BuildLogFile))
                                : null;
            string processLog = !string.IsNullOrEmpty(BuildLogFile)
                                ? Path.Combine(Path.GetDirectoryName(buildLogFullPath), "process.log")
                                : null;

            var logger = buildLogFullPath == null
                                ? string.Empty
                                : string.Format("/noconsolelogger \"/flp1:LogFile={0};Encoding=UTF-8;Verbosity={1}\"",
                                                buildLogFullPath, Verbosity.ToString().ToLower());

            var start        = DateTime.UtcNow;
            var args         = new StringBuilder();
            var psi          = new ProcessStartInfo(BuildTool);
            var responseFile = Path.Combine(XABuildPaths.TestOutputDirectory, Path.GetDirectoryName(projectOrSolution), "project.rsp");

            if (UseDotNet)
            {
                args.Append("build ");
            }
            args.AppendFormat("{0} /t:{1} {2}",
                              QuoteFileName(Path.Combine(XABuildPaths.TestOutputDirectory, projectOrSolution)), target, logger);
            if (UseDotNet)
            {
                if (!AutomaticNuGetRestore)
                {
                    args.Append(" --no-restore");
                }
            }
            else if (AutomaticNuGetRestore && restore)
            {
                args.Append(" /restore");
            }
            if (MaxCpuCount != null)
            {
                if (!string.Equals(Path.GetFileNameWithoutExtension(psi.FileName), "xabuild", StringComparison.OrdinalIgnoreCase))
                {
                    args.Append($" /maxCpuCount:{MaxCpuCount}");
                    args.Append(" /nodeReuse:false");                      // Disable the MSBuild daemon
                }
                else
                {
                    Console.WriteLine($"Ignoring MaxCpuCount={MaxCpuCount}, running with xabuild.");
                }
            }
            args.Append($" @\"{responseFile}\"");
            using (var sw = new StreamWriter(responseFile, append: false, encoding: Encoding.UTF8)) {
                sw.WriteLine($" /p:BuildingInsideVisualStudio={BuildingInsideVisualStudio}");
                if (BuildingInsideVisualStudio)
                {
                    sw.WriteLine(" /p:BuildingOutOfProcess=true");
                }
                string sdkPath = AndroidSdkResolver.GetAndroidSdkPath();
                if (Directory.Exists(sdkPath))
                {
                    sw.WriteLine(" /p:AndroidSdkDirectory=\"{0}\" ", sdkPath);
                }
                string ndkPath = AndroidSdkResolver.GetAndroidNdkPath();
                if (Directory.Exists(ndkPath))
                {
                    sw.WriteLine(" /p:AndroidNdkDirectory=\"{0}\" ", ndkPath);
                }
                string jdkPath = AndroidSdkResolver.GetJavaSdkPath();
                if (Directory.Exists(jdkPath))
                {
                    sw.WriteLine(" /p:JavaSdkDirectory=\"{0}\" ", jdkPath);
                }
                if (parameters != null)
                {
                    foreach (var param in parameters)
                    {
                        sw.WriteLine(" /p:{0}", param);
                    }
                }
                var msbuildArgs = Environment.GetEnvironmentVariable("NUNIT_MSBUILD_ARGS");
                if (!string.IsNullOrEmpty(msbuildArgs))
                {
                    sw.WriteLine(msbuildArgs);
                }

                psi.EnvironmentVariables ["MSBUILD"] = "msbuild";
                sw.WriteLine($" /bl:\"{Path.GetFullPath (Path.Combine (XABuildPaths.TestOutputDirectory, Path.GetDirectoryName (projectOrSolution), "msbuild.binlog"))}\"");

                if (environmentVariables != null)
                {
                    foreach (var kvp in environmentVariables)
                    {
                        psi.EnvironmentVariables [kvp.Key] = kvp.Value;
                    }
                }
            }

            //NOTE: commit messages can "accidentally" cause test failures
            // Consider if you added an error message in a commit message, then wrote a test asserting the error no longer occurs.
            // Both Jenkins and VSTS have an environment variable containing the full commit message, which will inexplicably cause your test to fail...
            // For a Jenkins case, see https://github.com/xamarin/xamarin-android/pull/1049#issuecomment-347625456
            // For a VSTS case, see http://build.devdiv.io/1806783
            psi.EnvironmentVariables ["ghprbPullLongDescription"]       =
                psi.EnvironmentVariables ["BUILD_SOURCEVERSIONMESSAGE"] = "";

            psi.Arguments = args.ToString();

            psi.CreateNoWindow         = true;
            psi.UseShellExecute        = false;
            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError  = true;
            psi.StandardErrorEncoding  = Encoding.UTF8;
            psi.StandardOutputEncoding = Encoding.UTF8;

            bool             nativeCrashDetected = false;
            bool             result          = false;
            bool             ranToCompletion = false;
            int              attempts        = 1;
            ManualResetEvent err             = new ManualResetEvent(false);
            ManualResetEvent stdout          = new ManualResetEvent(false);

            for (int attempt = 0; attempt < attempts; attempt++)
            {
                if (processLog != null)
                {
                    File.AppendAllText(processLog, psi.FileName + " " + args.ToString() + Environment.NewLine);
                }
                using (var p = new Process()) {
                    p.ErrorDataReceived += (sender, e) => {
                        if (e.Data != null && !string.IsNullOrEmpty(processLog))
                        {
                            File.AppendAllText(processLog, e.Data + Environment.NewLine);
                            if (e.Data.StartsWith(SigSegvError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                            if (e.Data.StartsWith(ConsoleLoggerError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                        }
                        if (e.Data == null)
                        {
                            err.Set();
                        }
                    };
                    p.OutputDataReceived += (sender, e) => {
                        if (e.Data != null && !string.IsNullOrEmpty(processLog))
                        {
                            File.AppendAllText(processLog, e.Data + Environment.NewLine);
                            if (e.Data.StartsWith(SigSegvError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                            if (e.Data.StartsWith(ConsoleLoggerError, StringComparison.OrdinalIgnoreCase))
                            {
                                nativeCrashDetected = true;
                            }
                        }
                        if (e.Data == null)
                        {
                            stdout.Set();
                        }
                    };
                    p.StartInfo = psi;
                    Console.WriteLine($"{psi.FileName} {psi.Arguments}");
                    p.Start();
                    p.BeginOutputReadLine();
                    p.BeginErrorReadLine();
                    ranToCompletion = p.WaitForExit((int)new TimeSpan(0, 15, 0).TotalMilliseconds);
                    if (psi.RedirectStandardOutput)
                    {
                        stdout.WaitOne();
                    }
                    if (psi.RedirectStandardError)
                    {
                        err.WaitOne();
                    }
                    result = ranToCompletion && p.ExitCode == 0;
                }

                LastBuildTime = DateTime.UtcNow - start;

                if (processLog != null && !ranToCompletion)
                {
                    File.AppendAllText(processLog, "Build Timed Out!");
                }
                if (buildLogFullPath != null && File.Exists(buildLogFullPath))
                {
                    foreach (var line in LastBuildOutput)
                    {
                        if (line.StartsWith("Time Elapsed", StringComparison.OrdinalIgnoreCase))
                        {
                            var match = timeElapsedRegEx.Match(line);
                            if (match.Success)
                            {
                                LastBuildTime = TimeSpan.Parse(match.Groups ["TimeSpan"].Value);
                                Console.WriteLine($"Found Time Elapsed {LastBuildTime}");
                            }
                        }
                    }
                }

                if (nativeCrashDetected)
                {
                    Console.WriteLine($"Native crash detected! Running the build for {projectOrSolution} again.");
                    if (attempt == 0)
                    {
                        File.Move(processLog, processLog + ".bak");
                    }
                    nativeCrashDetected = false;
                    continue;
                }
                else
                {
                    break;
                }
            }


            if (buildLogFullPath != null && processLog != null)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(buildLogFullPath));
                if (File.Exists(processLog))
                {
                    File.AppendAllText(buildLogFullPath, File.ReadAllText(processLog));
                }
            }
            if (!result && ThrowOnBuildFailure)
            {
                string message = "Build failure: " + Path.GetFileName(projectOrSolution) + (BuildLogFile != null && File.Exists(buildLogFullPath) ? "Build log recorded at " + buildLogFullPath : null);
                //NOTE: enormous logs will lock up IDE's UI. Build result files should be appended to the TestResult on failure.
                throw new FailedBuildException(message);
            }

            return(result);
        }
Exemplo n.º 45
0
 public TeamCityLog(IConsole console, Verbosity verbosity = Verbosity.Normal)
 {
     _cakeLogImplementation = new CakeBuildLog(console, verbosity);
 }
Exemplo n.º 46
0
 /// <summary>
 /// Writes an informational message to the log using the specified verbosity and log message action.
 /// Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="logAction">The log action.</param>
 public static void Information(this ICakeLog log, Verbosity verbosity, LogAction logAction)
 {
     Write(log, verbosity, LogLevel.Information, logAction);
 }
Exemplo n.º 47
0
        public static void WriteProcessedFilesAndDirectories(
            SearchTelemetry telemetry,
            SearchTarget searchTarget,
            string processedFilesTitle,
            string processedDirectoriesTitle,
            bool dryRun,
            Verbosity verbosity = Verbosity.Detailed)
        {
            if (!ShouldLog(verbosity))
            {
                return;
            }

            WriteLine(verbosity);

            const string filesTitle       = "Matching files";
            const string directoriesTitle = "Matching directories";

            bool files       = searchTarget != SearchTarget.Directories;
            bool directories = searchTarget != SearchTarget.Files;

            string matchingFileCount       = telemetry.MatchingFileCount.ToString("n0");
            string matchingDirectoryCount  = telemetry.MatchingDirectoryCount.ToString("n0");
            string processedFileCount      = telemetry.ProcessedFileCount.ToString("n0");
            string processedDirectoryCount = telemetry.ProcessedDirectoryCount.ToString("n0");

            int width1 = Math.Max(filesTitle.Length, processedFilesTitle.Length);
            int width2 = Math.Max(matchingFileCount.Length, processedFileCount.Length);
            int width3 = Math.Max(directoriesTitle.Length, processedDirectoriesTitle.Length);
            int width4 = Math.Max(matchingDirectoryCount.Length, processedDirectoryCount.Length);

            ConsoleColors colors = Colors.Message_OK;

            if (files)
            {
                WriteCount(filesTitle, matchingFileCount, width1, width2, colors, verbosity);
            }

            if (directories)
            {
                if (files)
                {
                    Write("  ", colors, verbosity);
                }

                WriteCount(directoriesTitle, matchingDirectoryCount, width3, width4, colors, verbosity);
            }

            WriteLine(verbosity);

            colors = (dryRun) ? Colors.Message_DryRun : Colors.Message_Change;

            if (files)
            {
                WriteCount(processedFilesTitle, processedFileCount, width1, width2, colors, verbosity);
            }

            if (directories)
            {
                if (files)
                {
                    Write("  ", colors, verbosity);
                }

                WriteCount(processedDirectoriesTitle, processedDirectoryCount, width3, width4, colors, verbosity);
            }

            WriteLine(verbosity);
        }
Exemplo n.º 48
0
		public Task PostEntryNoTimestampAsync(Verbosity verbosity, string message, params object[] values)
		{
			return Task.FromResult(false);
		}
Exemplo n.º 49
0
        public static bool TryParseOutputOptions(
            IEnumerable <string> values,
            string optionName,
            out string?path,
            out Verbosity verbosity,
            [NotNullWhen(true)] out Encoding?encoding,
            out bool append)
        {
            path      = null;
            verbosity = Verbosity.Normal;
            encoding  = Encoding.UTF8;
            append    = false;

            if (!values.Any())
            {
                return(true);
            }

            if (!TryEnsureFullPath(values.First(), out path))
            {
                return(false);
            }

            foreach (string value in values.Skip(1))
            {
                string option = value;

                int index = option.IndexOf('=');

                if (index >= 0)
                {
                    string key    = option.Substring(0, index);
                    string value2 = option.Substring(index + 1);

                    if (OptionValues.Verbosity.IsKeyOrShortKey(key))
                    {
                        if (!TryParseVerbosity(value2, out verbosity))
                        {
                            return(false);
                        }
                    }
                    else if (OptionValues.Encoding.IsKeyOrShortKey(key))
                    {
                        if (!TryParseEncoding(value2, out encoding))
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        WriteOptionError(value, optionName, OptionValueProviders.OutputFlagsProvider);
                        return(false);
                    }
                }
                else if (OptionValues.Output_Append.IsValueOrShortValue(value))
                {
                    append = true;
                }
                else
                {
                    WriteOptionError(value, optionName, OptionValueProviders.OutputFlagsProvider);
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 50
0
		public void PostEntryNoTimestamp(Verbosity verbosity, string message, params object[] values) { }
Exemplo n.º 51
0
 protected abstract void WriteSummary(SearchTelemetry telemetry, Verbosity verbosity);
Exemplo n.º 52
0
 public Logger(Verbosity verbosity) => this.verbosity = verbosity;
Exemplo n.º 53
0
 /// <summary>
 /// Writes a warning message to the log using the specified verbosity and log message action.
 /// Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="logAction">The log action.</param>
 public static void Warning(this ICakeLog log, Verbosity verbosity, LogAction logAction)
 {
     Write(log, verbosity, LogLevel.Warning, logAction);
 }
Exemplo n.º 54
0
            public void Should_Write_Log_Messages_Written_With_A_Higher_Verbosity_Than_Allowed(Verbosity logVerbosity, Verbosity messageVerbosity)
            {
                // Given
                var console = new FakeConsole();
                var log     = new CakeBuildLog(console, logVerbosity);

                // When
                log.Write(messageVerbosity, LogLevel.Information, "Hello World");

                // Then
                Assert.Single(console.Messages);
            }
Exemplo n.º 55
0
        private static ProcessArgumentBuilder GetNpmInstallArguments(NpmInstallSettings settings, Verbosity cakeVerbosityLevel, NpmLogLevel?logLevel)
        {
            var args = new ProcessArgumentBuilder();

            if (!logLevel.HasValue)
            {
                logLevel = CakeToNpmLogLevelConverter(cakeVerbosityLevel);
            }
            settings.Evaluate(args);
            AppendLogLevel(args, logLevel);
            return(args);
        }
Exemplo n.º 56
0
        protected override string GenerateCommandLineCommands()
        {
            var commandLine = new CommandLineBuilder();

            commandLine.AppendSwitch("-p:\"delay\"");

            commandLine.AppendSwitchIfNotNull("-t:", TargetType.ToLower());
            commandLine.AppendSwitchIfNotNull("-o:", OutputAssembly);
            commandLine.AppendSwitchIfNotNull("-c:", Culture);
            commandLine.AppendSwitchIfNotNull("-srcdir:", SourceDirectory);
            commandLine.AppendSwitchIfNotNull("-keyfile:", KeyFile);
            commandLine.AppendSwitchIfNotNull("-keycontainer:", KeyContainer);
            //commandLine.AppendSwitchIfNotNull("-p:", Pipeline);
            commandLine.AppendSwitchIfNotNull("-define:", DefineSymbols);
            commandLine.AppendSwitchIfNotNull("-lib:", AdditionalLibPaths, ",");
            commandLine.AppendSwitchIfNotNull("-nowarn:", DisabledWarnings);
            commandLine.AppendSwitchIfNotNull("-warn:", OptionalWarnings);
            commandLine.AppendSwitchIfNotNull("-platform:", Platform);

            if (TreatWarningsAsErrors)
            {
                commandLine.AppendSwitch("-warnaserror");             // all warnings are errors
            }
            else
            {
                commandLine.AppendSwitchIfNotNull("-warnaserror:", WarningsAsErrors);             // only specific warnings are errors
            }
            if (NoLogo)
            {
                commandLine.AppendSwitch("-nologo");
            }

            if (NoConfig)
            {
                commandLine.AppendSwitch("-noconfig");
            }

            if (NoStandardLib)
            {
                commandLine.AppendSwitch("-nostdlib");
            }

            if (DelaySign)
            {
                commandLine.AppendSwitch("-delaysign");
            }

            if (WhiteSpaceAgnostic)
            {
                commandLine.AppendSwitch("-wsa");
            }

            if (Ducky)
            {
                commandLine.AppendSwitch("-ducky");
            }

            if (Utf8Output)
            {
                commandLine.AppendSwitch("-utf8");
            }

            if (Strict)
            {
                commandLine.AppendSwitch("-strict");
            }

            if (AllowUnsafeBlocks)
            {
                commandLine.AppendSwitch("-unsafe");
            }

            commandLine.AppendSwitch(EmitDebugInformation ? "-debug+" : "-debug-");

            commandLine.AppendSwitch(CheckForOverflowUnderflow ? "-checked+" : "-checked-");

            foreach (var rsp in ResponseFiles)
            {
                commandLine.AppendSwitchIfNotNull("@", rsp.ItemSpec);
            }

            foreach (var reference in References)
            {
                commandLine.AppendSwitchIfNotNull("-r:", reference.ItemSpec);
            }

            foreach (var resource in Resources)
            {
                switch (resource.GetMetadata("Type"))
                {
                case "Resx":
                    commandLine.AppendSwitchIfNotNull("-resource:", resource.ItemSpec + "," + resource.GetMetadata("LogicalName"));
                    break;

                case "Non-Resx":
                    commandLine.AppendSwitchIfNotNull("-embedres:", resource.ItemSpec + "," + resource.GetMetadata("LogicalName"));
                    break;
                }
            }

            if (!string.IsNullOrEmpty(Verbosity))
            {
                switch (Verbosity.ToLower())
                {
                case "normal":
                    break;

                case "warning":
                    commandLine.AppendSwitch("-v");
                    break;

                case "info":
                    commandLine.AppendSwitch("-vv");
                    break;

                case "verbose":
                    commandLine.AppendSwitch("-vvv");
                    break;

                default:
                    Log.LogErrorWithCodeFromResources(
                        "Vbc.EnumParameterHasInvalidValue",
                        "Verbosity",
                        Verbosity,
                        "Normal, Warning, Info, Verbose");
                    break;
                }
            }

            commandLine.AppendFileNamesIfNotNull(Sources, " ");

            return(commandLine.ToString());
        }
Exemplo n.º 57
0
		public Task PostBlankAsync(Verbosity verbosity = Verbosity.Info)
		{
			return Task.FromResult(false);
		}
Exemplo n.º 58
0
 /// <summary>
 /// Writes a debug message to the log using the specified verbosity and log message action.
 /// Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="logAction">The log action.</param>
 public static void Debug(this ICakeLog log, Verbosity verbosity, LogAction logAction)
 {
     Write(log, verbosity, LogLevel.Debug, logAction);
 }
Exemplo n.º 59
0
 /// <summary>
 /// Writes an error message to the log using the specified verbosity and log message action.
 /// Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="verbosity">The verbosity.</param>
 /// <param name="logAction">The log action.</param>
 public static void Error(this ICakeLog log, Verbosity verbosity, LogAction logAction)
 {
     Write(log, verbosity, LogLevel.Error, logAction);
 }
Exemplo n.º 60
0
		public void PostBlank(Verbosity verbosity = Verbosity.Info) { }