Skip to content

Commit

Permalink
Add additional logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
peters committed Sep 3, 2024
1 parent b1007ce commit cfa9124
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/Snap/Core/Snapx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,27 @@ static Snapx()
try
{
Logger = LogProvider.GetLogger(nameof(Snapx));
var informationalVersion = typeof(Snapx).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
Version = !SemanticVersion.TryParse(informationalVersion, out var currentVersion) ? null : currentVersion;

var snapxAssembly = typeof(Snapx).Assembly;

Logger.Debug("Assembly location: {0}.", snapxAssembly.Location);

var informationalVersion = snapxAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
Version = informationalVersion == null ? null : !SemanticVersion.TryParse(informationalVersion, out var currentVersion) ? null : currentVersion;

Logger.Debug("Assembly version: {0}.", Version);

SnapOs = AnyOS.SnapOs.AnyOs;
WorkingDirectory = SnapOs.Filesystem.PathGetDirectoryName(typeof(Snapx).Assembly.Location);
WorkingDirectory = SnapOs.Filesystem.PathGetDirectoryName(snapxAssembly.Location);

Logger.Debug("Assembly working directory: {0}.", WorkingDirectory);

_current = WorkingDirectory.GetSnapAppFromDirectory(SnapOs.Filesystem, new SnapAppReader());

typeof(Snapx).Assembly
snapxAssembly
.GetStubExeFullPath(SnapOs.Filesystem, new SnapAppReader(), out var supervisorExecutableAbsolutePath);

Logger.Debug("Supervisor executable path: {0}.", supervisorExecutableAbsolutePath);

SuperVisorProcessExeDirectory = supervisorExecutableAbsolutePath;
}
Expand Down

0 comments on commit cfa9124

Please sign in to comment.