Skip to content

Commit

Permalink
feat: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Jan 28, 2023
1 parent 532f1ff commit d726e41
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Oxide.Ext.GamingApi/GamingApiNats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private string GetNatsHost()
Console.WriteLine($"NATS: {envName} environment variable not sat using default value.");
return "nats://localhost:4222";
}
Console.WriteLine($"NATS: {envName} loading - {value}");
return value;
}

Expand All @@ -146,13 +147,15 @@ private string GetNatsAuthenticationType()
Console.WriteLine($"NATS: {envName} environment variable not sat using default value.");
return "jwt";
}
Console.WriteLine($"NATS: {envName} loading - {value}");
return value;
}

private string GetNatsNkeyUser()
{
var envName = $"GAMINGAPI_NATS_NKEY_USER";
var value = Environment.GetEnvironmentVariable(envName);
Console.WriteLine($"NATS: {envName} loading");
if (value == null)
{
Console.WriteLine($"NATS: {envName} environment variable not sat using default value.");
Expand All @@ -166,15 +169,16 @@ private string GetNatsNkeySeed()
var envName = $"GAMINGAPI_NATS_NKEY_SEED";
var envFileName = envName + "_FILE";


var fileName = Environment.GetEnvironmentVariable(envFileName);
if (fileName != null)
{
Console.WriteLine($"NATS: {envFileName} loading from file");
string contents = File.ReadAllText(@fileName);
return contents;
}

var value = Environment.GetEnvironmentVariable(envName);
Console.WriteLine($"NATS: {envName} loading");
if (value == null)
{
Console.WriteLine($"NATS: {envName} environment variable not sat using default value.");
Expand All @@ -189,15 +193,16 @@ private string GetNatsJwtUser()
var envName = $"GAMINGAPI_NATS_JWT_USER";
var envFileName = envName + "_FILE";


var fileName = Environment.GetEnvironmentVariable(envFileName);
if (fileName != null)
{
Console.WriteLine($"NATS: {envFileName} loading from file");
string contents = File.ReadAllText(@fileName);
return contents;
}

var value = Environment.GetEnvironmentVariable(envName);
Console.WriteLine($"NATS: {envName} loading");
if (value == null)
{
Console.WriteLine($"NATS: {envName} environment variable not sat using default value.");
Expand Down

0 comments on commit d726e41

Please sign in to comment.