Changeset 2591 for trunk/sources/HeuristicLab.Tracing
- Timestamp:
- 01/05/10 10:31:40 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Tracing/3.2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tracing/3.2/HeuristicLabTracingPlugin.cs
r1534 r2591 3 3 namespace HeuristicLab.Tracing { 4 4 5 [ ClassInfo(Name ="HeuristicLab.Tracing-3.2")]6 [PluginFile( Filename = "HeuristicLab.Tracing-3.2.dll", Filetype =PluginFileType.Assembly)]7 [PluginFile( Filename = "log4net.dll", Filetype =PluginFileType.Assembly)]8 [PluginFile( Filename = "log4net licence.txt", Filetype =PluginFileType.License)]9 [PluginFile( Filename = "HeuristicLab.log4net.xml", Filetype =PluginFileType.Data)]5 [Plugin("HeuristicLab.Tracing-3.2")] 6 [PluginFile("HeuristicLab.Tracing-3.2.dll", PluginFileType.Assembly)] 7 [PluginFile("log4net.dll", PluginFileType.Assembly)] 8 [PluginFile("log4net licence.txt", PluginFileType.License)] 9 [PluginFile("HeuristicLab.log4net.xml", PluginFileType.Data)] 10 10 public class HeuristicLabPersistencePlugin : PluginBase {} 11 11 -
trunk/sources/HeuristicLab.Tracing/3.2/HiveLogger.cs
r1935 r2591 14 14 if (string.IsNullOrEmpty(Settings.Default.TracingLog4netConfigFile)) { 15 15 Settings.Default.TracingLog4netConfigFile = 16 Path.Combine( 17 PluginInfrastructure.Properties.Settings.Default.PluginDir, 18 "HeuristicLab.Hive.log4net.xml"); 16 "HeuristicLab.Hive.log4net.xml"; 19 17 } 20 18 XmlConfigurator.ConfigureAndWatch( … … 26 24 Configure(); 27 25 StackFrame frame = new StackFrame(nParents + 1); 28 return LogManager.GetLogger(frame.GetMethod().DeclaringType); 26 return LogManager.GetLogger(frame.GetMethod().DeclaringType); 29 27 } 30 28 … … 47 45 } 48 46 49 public static void Error(object message) { 47 public static void Error(object message) { 50 48 GetDefaultLogger(1).Error(message); 51 49 } … … 62 60 public static void Info(Type type, object message) { 63 61 Configure(); 64 LogManager.GetLogger(type).Info(message); 62 LogManager.GetLogger(type).Info(message); 65 63 } 66 64 67 65 public static void Warn(Type type, object message) { 68 66 Configure(); 69 LogManager.GetLogger(type).Warn(message); 67 LogManager.GetLogger(type).Warn(message); 70 68 } 71 69 -
trunk/sources/HeuristicLab.Tracing/3.2/Logger.cs
r1933 r2591 13 13 14 14 protected static void Configure() { 15 if ( IsConfigured) return;15 if (IsConfigured) return; 16 16 IsConfigured = true; 17 17 if (string.IsNullOrEmpty(Settings.Default.TracingLog4netConfigFile)) { 18 Settings.Default.TracingLog4netConfigFile = 19 Path.Combine( 20 PluginInfrastructure.Properties.Settings.Default.PluginDir, 21 "HeuristicLab.log4net.xml"); 18 Settings.Default.TracingLog4netConfigFile = 19 "HeuristicLab.log4net.xml"; 22 20 } 23 21 XmlConfigurator.ConfigureAndWatch( … … 29 27 Configure(); 30 28 StackFrame frame = new StackFrame(nParents + 1); 31 return LogManager.GetLogger(frame.GetMethod().DeclaringType); 29 return LogManager.GetLogger(frame.GetMethod().DeclaringType); 32 30 } 33 31 … … 50 48 } 51 49 52 public static void Error(object message) { 50 public static void Error(object message) { 53 51 GetDefaultLogger(1).Error(message); 54 52 } … … 65 63 public static void Info(Type type, object message) { 66 64 Configure(); 67 LogManager.GetLogger(type).Info(message); 65 LogManager.GetLogger(type).Info(message); 68 66 } 69 67 70 68 public static void Warn(Type type, object message) { 71 69 Configure(); 72 LogManager.GetLogger(type).Warn(message); 70 LogManager.GetLogger(type).Warn(message); 73 71 } 74 72
Note: See TracChangeset
for help on using the changeset viewer.