Skip to content

Commit

Permalink
Merge pull request #131 from GlassesPi/nologo-arg-cli
Browse files Browse the repository at this point in the history
Add --no-logo cli arg for not showing the logo
  • Loading branch information
natenho authored Mar 23, 2024
2 parents 6703e0e + da3fe68 commit ca7a86a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Mockaco/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.Reflection;
using Mockaco.Templating.Generating;
using System;
using System.Linq;

namespace Mockaco
{
using Settings;

public partial class Startup
{
private readonly IConfiguration _configuration;
Expand All @@ -29,9 +28,15 @@ public void Configure(IApplicationBuilder app, ILogger<Startup> logger)
{
var assemblyName = Assembly.GetExecutingAssembly().GetName().Name;
var version = GitVersionInformation.InformationalVersion;
var isNoLogoPassed = Environment.GetCommandLineArgs().Contains("--no-logo");

var logMessage = "{assemblyName} v{assemblyVersion} [github.com/natenho/Mockaco]";

if (!isNoLogoPassed)
logMessage += "\n\n{logo}";

logger.LogInformation(logMessage, assemblyName, version, _logo);

logger.LogInformation("{assemblyName} v{assemblyVersion} [github.com/natenho/Mockaco]\n\n{logo}", assemblyName, version, _logo);

app
.UseCors()
.UseMockaco();
Expand Down

0 comments on commit ca7a86a

Please sign in to comment.