1 28 29 package ist.coach.coachEmfClientComponents.ManagedObjectClientComposition; 30 31 import ist.coach.coachEmfClientComponents.gui.GuiMaster; 32 import java.text.DateFormat ; 33 import ist.coach.coachEmfCommon.Utils; 34 import ist.coach.coachEmfServices.EmfBasicLog.LogSeverity; 35 import ist.coach.coachEmfClientComponents.gui.GuiMessages; 36 42 public class logNewRecordSegImpl 43 extends ist.coach.coachEmfClientComponents.ManagedObjectClientComposition.logNewRecordSeg 44 { 45 51 57 public logNewRecordSegImpl() 58 { 59 60 } 61 62 68 71 public void 72 push(ist.coach.coachEmfServicesComponents.LogNewRecord event) 73 { 74 75 82 java.util.Date event_date = new java.util.Date (event.eventTime.time); 83 String event_type_str = GuiMessages.info_log; 84 String event_type = GuiMaster.INFO_LOG; 85 86 switch(event.severity.value()) { 87 case LogSeverity._Error : 88 event_type_str = GuiMessages.error_log; 89 event_type = GuiMaster.ERROR_LOG; 90 break; 91 case LogSeverity._FatalError : 92 event_type_str = GuiMessages.fatal_error_log; 93 event_type = GuiMaster.FATAL_LOG; 94 break; 95 case LogSeverity._Warning : 96 event_type_str = GuiMessages.warning_log; 97 event_type = GuiMaster.WARNING_LOG; 98 break; 99 }; 100 ManagedObjectClientImpl main_segment = (ManagedObjectClientImpl) get_main_segment(); 101 if (! main_segment.subscribed_log_events.contains(event_type)) 103 return; 104 105 DateFormat df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT); 106 String time_str = df.format(event_date); 107 108 109 main_segment.ui_client.print(time_str, 110 event_type_str, 111 Utils.name2string(event.source), 112 event.sourceClass, 113 String.valueOf(event.logRecordId), 114 event.info 115 ); 116 } 117 118 } 119 | Popular Tags |