close #47 Add log level config

This commit is contained in:
qianlifeng
2014-03-23 17:43:46 +08:00
parent 3dbef1400c
commit 61c1232690
6 changed files with 40 additions and 9 deletions

View File

@@ -71,7 +71,7 @@ namespace Wox.PluginLoader
if (!File.Exists(configPath))
{
Log.Error(string.Format("parse plugin {0} failed: didn't find config file.", configPath));
Log.Warn(string.Format("parse plugin {0} failed: didn't find config file.", configPath));
return null;
}
@@ -84,7 +84,7 @@ namespace Wox.PluginLoader
catch (Exception)
{
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath);
Log.Error(error);
Log.Warn(error);
#if (DEBUG)
{
throw new WoxException(error);
@@ -98,7 +98,7 @@ namespace Wox.PluginLoader
{
string error = string.Format("Parse plugin config {0} failed: invalid language {1}", configPath,
metadata.Language);
Log.Error(error);
Log.Warn(error);
#if (DEBUG)
{
throw new WoxException(error);
@@ -110,7 +110,7 @@ namespace Wox.PluginLoader
{
string error = string.Format("Parse plugin config {0} failed: ExecuteFile {1} didn't exist", configPath,
metadata.ExecuteFilePath);
Log.Error(error);
Log.Warn(error);
#if (DEBUG)
{
throw new WoxException(error);

View File

@@ -25,7 +25,7 @@ namespace Wox.PluginLoader
List<Type> types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && (o.BaseType == typeof(BaseSystemPlugin) || o.GetInterfaces().Contains(typeof(IPlugin)))).ToList();
if (types.Count == 0)
{
Log.Error(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin",
Log.Warn(string.Format("Cound't load plugin {0}: didn't find the class who implement IPlugin",
metadata.Name));
continue;
}

View File

@@ -39,7 +39,7 @@ namespace Wox.PluginLoader
PythonEngine.Shutdown();
}
catch {
Log.Error("Could't find python environment, all python plugins disabled.");
Log.Warn("Could't find python environment, all python plugins disabled.");
return false;
}
return true;