BUG-2079: Small changes for the bug, to help to track the issue. [skip ci]

This commit is contained in:
Robin 2016-12-26 20:32:06 +01:00
commit 4f289d838a
3 changed files with 34 additions and 7 deletions

View file

@ -159,6 +159,7 @@ namespace GreenshotJiraPlugin {
_loggedInTime = DateTime.Now;
return;
}
// Login failed, confirm this
try {
credentialsDialog.Confirm(false);
} catch (ApplicationException e) {

View file

@ -27,13 +27,14 @@ using System.Threading.Tasks;
using Dapplo.Log.Facade;
using GreenshotJiraPlugin.Forms;
using GreenshotPlugin.Core;
using log4net;
namespace GreenshotJiraPlugin {
/// <summary>
/// This is the JiraPlugin base code
/// </summary>
public class JiraPlugin : IGreenshotPlugin {
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraPlugin));
private static readonly ILog Log = LogManager.GetLogger(typeof(JiraPlugin));
private JiraConfiguration _config;
private static JiraPlugin _instance;
private JiraConnector _jiraConnector;
@ -94,7 +95,32 @@ namespace GreenshotJiraPlugin {
public bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
// Register configuration (don't need the configuration itself)
_config = IniConfig.GetIniSection<JiraConfiguration>();
LogSettings.RegisterDefaultLogger<Log4NetLogger>();
// Make sure the loggin is enable for the corect level.
if (Log.IsDebugEnabled)
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Verbose);
}
else if (Log.IsInfoEnabled)
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Info);
}
else if (Log.IsWarnEnabled)
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Warn);
}
else if (Log.IsErrorEnabled)
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Error);
}
else if (Log.IsErrorEnabled)
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Error);
}
else
{
LogSettings.RegisterDefaultLogger<Log4NetLogger>(LogLevels.Fatal);
}
// Add a SVG converter, although it doesn't fit to the Jira plugin there is currently no other way
ImageHelper.StreamConverters["svg"] = (stream, s) =>