File: System\Deployment\Application\Logger.cs
Project: System.Deployment.dll (System.Deployment)
#region Assembly System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Deployment.dll
#endregion
 
using System.Collections;
using System.Deployment.Application.Manifest;
using System.Deployment.Internal.Isolation;
using System.Diagnostics;
using System.IO;
using System.Text;
 
namespace System.Deployment.Application
{
    internal class Logger
    {
        protected static bool _detailedLoggingEnabled;
        protected static object _header;
        protected static object _logAccessLock;
        protected static object _logFileEncoding;
        protected static Hashtable _loggerCollection;
        protected static Hashtable _threadLogIdTable;
        protected ErrorSection _errors;
        protected ExecutionFlowSection _executionFlow;
        protected IdentitySection _identities;
        protected LogFileLocation _logFileLocation;
        protected string _logFilePath;
        protected LogIdentity _logIdentity;
        protected PhaseSection _phases;
        protected SourceSection _sources;
        protected SummarySection _summary;
        protected TransactionSection _transactions;
        protected string _urlName;
        protected WarningSection _warnings;
 
        protected Logger();
 
        protected static HeaderSection Header { get; }
        protected static Encoding LogFileEncoding { get; }
        protected ErrorSection Errors { get; }
        protected ExecutionFlowSection ExecutionFlow { get; }
        protected IdentitySection Identities { get; }
        protected LogIdentity Identity { get; }
        protected string LogFilePath { get; }
        protected PhaseSection Phases { get; }
        protected SourceSection Sources { get; }
        protected SummarySection Summary { get; }
        protected TransactionSection Transactions { get; }
        protected WarningSection Warnings { get; }
 
        protected static void AddCurrentThreadLogger(Logger logger);
        protected static void AddLogger(Logger logger);
        protected static uint GetCurrentLogThreadId();
        protected static Logger GetCurrentThreadLogger();
        protected static Logger GetLogger(LogIdentity logIdentity);
        protected static string GetRegitsryBasedLogFilePath();
        protected static void RemoveCurrentThreadLogger();
        protected static void RemoveLogger(LogIdentity logIdentity);
        protected FileStream CreateLogFileStream();
        protected void EndLogOperation();
        protected bool FlushLogs();
        protected string GetWinInetBasedLogFilePath();
 
        protected enum LogFileLocation
        {
            NoLogFile,
            RegistryBased,
            WinInetCache
        }
 
        public class LogIdentity
        {
            protected string _logIdentityStringForm;
            protected readonly uint _threadId;
            protected readonly long _ticks;
 
            public LogIdentity();
 
            public uint ThreadId { get; }
 
            public override string ToString();
        }
        protected class ErrorInformation : LogInformation
        {
            protected Exception _exception;
 
            public ErrorInformation(string message, Exception exception, DateTime time);
 
            public string Summary { get; }
 
            public override string ToString();
        }
        protected class ErrorSection : LogInformation
        {
            protected ArrayList _errors;
 
            public ErrorSection();
 
            public string ErrorSummary { get; }
 
            public void AddError(string message, Exception exception, DateTime time);
            public override string ToString();
        }
        protected class ExecutionFlowSection : LogInformation
        {
            protected ArrayList _executionFlow;
 
            public ExecutionFlowSection();
 
            public void AddInternalState(string phaseMessage, DateTime time);
            public void AddMethodCall(string phaseMessage, DateTime time);
            public override string ToString();
        }
        protected class HeaderSection : LogInformation
        {
            public HeaderSection();
 
            protected static string GenerateLogHeaderText();
            protected static string GetExecutingAssemblyPath();
            protected static string GetModulePath(string moduleName);
            protected static string GetModulePathInClrFolder(string moduleName);
            protected static string GetModulePathInSystemFolder(string moduleName);
            protected static FileVersionInfo GetVersionInfo(string modulePath);
            public override string ToString();
        }
        protected class IdentitySection : LogInformation
        {
            protected DefinitionIdentity _applicationIdentity;
            protected DefinitionIdentity _deploymentIdentity;
 
            public IdentitySection();
 
            public DefinitionIdentity ApplicationIdentity { set; }
            public DefinitionIdentity DeploymentIdentity { get; set; }
 
            public override string ToString();
        }
        protected class LogInformation
        {
            protected string _message;
            protected DateTime _time;
 
            public LogInformation();
            public LogInformation(string message, DateTime time);
 
            public string Message { get; }
            public DateTime Time { get; }
        }
        protected class PhaseSection : LogInformation
        {
            protected ArrayList _phaseInformations;
 
            public PhaseSection();
 
            public void AddPhaseInformation(string phaseMessage, DateTime time);
            public override string ToString();
        }
        protected class SourceSection : LogInformation
        {
            protected ServerInformation _applicationServerInformation;
            protected Uri _applicationUri;
            protected ServerInformation _deploymentProviderServerInformation;
            protected Uri _deploymentProviderUri;
            protected ServerInformation _subscriptionServerInformation;
            protected Uri _subscriptonUri;
 
            public SourceSection();
 
            public ServerInformation ApplicationServerInformation { set; }
            public Uri ApplicationUri { set; }
            public ServerInformation DeploymentProviderServerInformation { set; }
            public Uri DeploymentProviderUri { set; }
            public ServerInformation SubscriptionServerInformation { set; }
            public Uri SubscriptionUri { set; }
 
            public override string ToString();
        }
        protected class SummarySection : LogInformation
        {
            protected AssemblyManifest _applicationManifest;
            protected AssemblyManifest _deploymentManifest;
 
            public SummarySection();
 
            public AssemblyManifest ApplicationManifest { set; }
            public AssemblyManifest DeploymentManifest { set; }
 
            public override string ToString();
        }
        protected class TransactionInformation : LogInformation
        {
            protected bool _failed;
            protected ArrayList _operations;
 
            public TransactionInformation(StoreTransactionOperation[] storeOperations, uint[] rgDispositions, int[] rgResults, DateTime time);
 
            public bool Failed { get; }
            public string FailureSummary { get; }
 
            public override string ToString();
 
            public class TransactionOperation
            {
                protected bool _failed;
                protected string _failureMessage;
                protected string _message;
 
                public TransactionOperation(StoreTransactionOperation operation, uint disposition, int hresult);
 
                public bool Failed { get; }
                public string FailureMessage { get; }
 
                public override string ToString();
                protected void AnalyzeTransactionOperation(StoreTransactionOperation operation, uint dispositionValue, int hresult);
            }
        }
        protected class TransactionSection : LogInformation
        {
            protected ArrayList _failedTransactionInformations;
            protected ArrayList _transactionInformations;
 
            public TransactionSection();
 
            public string FailureSummary { get; }
 
            public void AddTransactionInformation(StoreTransactionOperation[] storeOperations, uint[] rgDispositions, int[] rgResults, DateTime time);
            public override string ToString();
        }
        protected class WarningSection : LogInformation
        {
            protected ArrayList _warnings;
 
            public WarningSection();
 
            public void AddWarning(string message, DateTime time);
            public override string ToString();
        }
    }
}