protected void Page_Load(object sender, EventArgs e)
    {
        PageTitle.IsDialog = false;

        mGuid = QueryHelper.GetGuid("guid", Guid.Empty);
        if (mGuid != Guid.Empty)
        {
            // Find the logs
            var logs = DebugHelper.FindRequestLogs(mGuid);
            if (logs != null)
            {
                plcLogs.Append("<div><strong>&nbsp;", logs.RequestURL, "</strong> (", logs.RequestTime.ToString("hh:MM:ss"), ")</div><br />");

                foreach (var debug in DebugHelper.RegisteredDebugs)
                {
                    // Check if the debug is enabled
                    if (debug.Enabled && !string.IsNullOrEmpty(debug.LogControl))
                    {
                        // Load the debug control
                        var log = LoadUserControl(debug.LogControl) as LogControl;
                        if (log != null)
                        {
                            log.Logs = logs;

                            plcLogs.Append(log);
                        }
                    }
                }
            }
        }
    }
예제 #2
0
    /// <summary>
    /// Gets the debug action for the thread.
    /// </summary>
    /// <param name="requestGuid">Request GUID for the debug</param>
    protected string GetDebugAction(object requestGuid)
    {
        string result = null;

        if (DebugHelper.AnyDebugEnabled)
        {
            var rGuid = ValidationHelper.GetGuid(requestGuid, Guid.Empty);
            if (rGuid != Guid.Empty)
            {
                var logs = DebugHelper.FindRequestLogs(rGuid);
                if (logs != null)
                {
                    string url = LogControl.GetLogsUrl(rGuid);

                    var button = new CMSGridActionButton
                    {
                        IconCssClass  = "icon-bug",
                        IconStyle     = GridIconStyle.Allow,
                        ToolTip       = GetString("General.Debug"),
                        OnClientClick = "modalDialog('" + url + "', 'ThreadDebug'); return false;"
                    };

                    result = button.GetRenderedHTML();
                }
            }
        }

        return(result);
    }