diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 59972bc28..a44a6eaaf 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -90,13 +90,13 @@ namespace mbts.ui.shell else { // Second instance. Activate the main window and return NativeMethods.PostMessage(NativeMethods.HWND_BROADCAST, (WM)NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero); - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Starting a second shell is not allowed. Attempting to bring the original shell to the foreground."); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Starting a second shell is not allowed. Attempting to bring the original shell to the foreground."); } return 0; } } catch (AbandonedMutexException ame) { - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Shell mutex was abandoned. Releasing the mutex and trying again. \n" + ame.ToString()); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Shell mutex was abandoned. Releasing the mutex and trying again. \n" + ame.ToString()); _mutex.ReleaseMutex(); // Try agai until stack overflow return Run(); diff --git a/src/client/spark/core/GlobalExtensions/GlobalExtensions.cs b/src/client/spark/core/GlobalExtensions/GlobalExtensions.cs index 6a6c22bda..9cdf875da 100644 --- a/src/client/spark/core/GlobalExtensions/GlobalExtensions.cs +++ b/src/client/spark/core/GlobalExtensions/GlobalExtensions.cs @@ -208,7 +208,7 @@ namespace mbts // Some defenses against crashing when the source collection is if (!src.is_distinct(comp)) { Logger.assert_d(false); - Logger.error(bts.log.Subsystem.ui, "sync_with requires input to be distinct. Error in input of type {0}.".fmt(typeof(T).Name)); + Logger.error(bts.log.Subsystem.Ui, "sync_with requires input to be distinct. Error in input of type {0}.".fmt(typeof(T).Name)); } // First remove anything not in the destination @@ -235,7 +235,7 @@ namespace mbts ++d; } } catch (Exception ex) { - Logger.error(bts.log.Subsystem.ui, "sync_with error (Element T is {0}): {1}".fmt(typeof(T), ex)); + Logger.error(bts.log.Subsystem.Ui, "sync_with error (Element T is {0}): {1}".fmt(typeof(T), ex)); throw ex; } } @@ -244,7 +244,7 @@ namespace mbts public static bool sync_with_setwise(this ObservableCollection dest, IEnumerable src, IEqualityComparer comp) { if (!src.is_distinct(comp)) { Logger.assert_d(false); - Logger.error(bts.log.Subsystem.ui, "sync_with_setwise requires input to be distinct. Error in input of type {0}.".fmt(typeof(T).Name)); + Logger.error(bts.log.Subsystem.Ui, "sync_with_setwise requires input to be distinct. Error in input of type {0}.".fmt(typeof(T).Name)); } IEnumerable added, removed; dest.difference(src, out added, out removed, comp); diff --git a/src/client/spark/mspark/Ladder/LadderModel.cs b/src/client/spark/mspark/Ladder/LadderModel.cs index eaebf7479..3ff7b1cc8 100644 --- a/src/client/spark/mspark/Ladder/LadderModel.cs +++ b/src/client/spark/mspark/Ladder/LadderModel.cs @@ -29,7 +29,7 @@ namespace mbts.spark { public void cancel_orders(CancelType ct) { order_gateway.cancel_security_orders (new uint[] {security.Id}, ct == CancelType.Bids || ct == CancelType.All, ct == CancelType.Asks || ct == CancelType.All); - Logger.info(bts.log.Subsystem.ui, $"Cancel {ct}"); + Logger.info(bts.log.Subsystem.Ui, $"Cancel {ct}"); } public OrdersModel order_gateway => _order_gateway; diff --git a/src/client/spark/mspark/Ladder/LadderOrdersHost.cs b/src/client/spark/mspark/Ladder/LadderOrdersHost.cs index 2d94fa11d..a50731689 100644 --- a/src/client/spark/mspark/Ladder/LadderOrdersHost.cs +++ b/src/client/spark/mspark/Ladder/LadderOrdersHost.cs @@ -110,7 +110,7 @@ namespace mbts.spark { if (e.Data.GetDataPresent(typeof(OrderVM))) { OrderVM vm = e.Data.GetData(typeof(OrderVM)) as OrderVM; if (vm != null && vm.security_key == security_key) { - Logger.info(bts.log.Subsystem.ui, "Drop - " + vm.summary); + Logger.info(bts.log.Subsystem.Ui, "Drop - " + vm.summary); double price = _parent.price_for_point(e.GetPosition(_parent)); if (vm.try_change_price(price)) { if (remove_order(vm)) { diff --git a/src/client/spark/mspark/Ladder/LadderVM.cs b/src/client/spark/mspark/Ladder/LadderVM.cs index 19a14fa1a..8defb25a0 100644 --- a/src/client/spark/mspark/Ladder/LadderVM.cs +++ b/src/client/spark/mspark/Ladder/LadderVM.cs @@ -215,7 +215,7 @@ namespace mbts.spark { //Logger.notnull(i); if (i == null) { var msg = String.Join(" ",my_orders.Select(m => m.ID().Id)); - Logger.error(bts.log.Subsystem.ui, $"Equality problem in order {o.id} should be in {msg}."); + Logger.error(bts.log.Subsystem.Ui, $"Equality problem in order {o.id} should be in {msg}."); } if (i != null) { o.update(i); diff --git a/src/client/spark/mspark/Orders/OrdersModel.cs b/src/client/spark/mspark/Orders/OrdersModel.cs index e54e1b4e5..55565dcbb 100644 --- a/src/client/spark/mspark/Orders/OrdersModel.cs +++ b/src/client/spark/mspark/Orders/OrdersModel.cs @@ -72,7 +72,7 @@ namespace mbts.spark public bool change_price(OrderID order_id, double new_price) { - Logger.info(bts.log.Subsystem.ui, $"Change {order_id} price to {new_price}"); + Logger.info(bts.log.Subsystem.Ui, $"Change {order_id} price to {new_price}"); _bus.post (SparkTags.ChangeOrderPriceTag, new SparkBusData.ChangeOrderPriceMessage (new OrderUserActions.ChangeOrderPrice (order_id, new_price))); return true; } diff --git a/src/client/spark/mspark/Shell/Admin/DefaultOrderParametersMenu.cs b/src/client/spark/mspark/Shell/Admin/DefaultOrderParametersMenu.cs index 018556b3d..ab6090173 100644 --- a/src/client/spark/mspark/Shell/Admin/DefaultOrderParametersMenu.cs +++ b/src/client/spark/mspark/Shell/Admin/DefaultOrderParametersMenu.cs @@ -62,7 +62,7 @@ namespace mbts.spark editor_dialog.CommittedValues.Subscribe( x => BTSMessageBox.Show("Write this down: {0}".fmt(x.ToString())), - ex => Logger.error(bts.log.Subsystem.ui, "Error: {0}".fmt(ex.Message), "DefaultOrderParametersMenu.cs") + ex => Logger.error(bts.log.Subsystem.Ui, "Error: {0}".fmt(ex.Message), "DefaultOrderParametersMenu.cs") ); }) }); diff --git a/src/client/spark/mspark/Shell/MarketModule.cs b/src/client/spark/mspark/Shell/MarketModule.cs index eadacab77..9f315d05e 100644 --- a/src/client/spark/mspark/Shell/MarketModule.cs +++ b/src/client/spark/mspark/Shell/MarketModule.cs @@ -168,7 +168,7 @@ namespace mbts.spark if (msg.data.ContractCase != Security.ContractOneofCase.Synthetic) show_synthetic_editor_warning($"{msg.data} is not a synthetic security."); else if (!_synthetic_strategy_map.TryGetValue(msg.data.Id, out SyntheticExecutionStrategy ses)) { string warn_msg = $"Did not find execution strategy for {msg.data}"; - Logger.warn(bts.log.Subsystem.ui, warn_msg); + Logger.warn(bts.log.Subsystem.Ui, warn_msg); show_synthetic_editor_warning(warn_msg); } else show_synthetic_editor(msg.data, ses.ExecutionStrategy); } diff --git a/src/client/spark/uicore/BTSApplicationBootstrapper.cs b/src/client/spark/uicore/BTSApplicationBootstrapper.cs index 45228bdae..b17c0dd62 100644 --- a/src/client/spark/uicore/BTSApplicationBootstrapper.cs +++ b/src/client/spark/uicore/BTSApplicationBootstrapper.cs @@ -25,7 +25,7 @@ namespace mbts.ui } static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { - Logger.log(Level.Error, Subsystem.ui, "Unhandled Exception: " + e.ExceptionObject.ToString()); + Logger.log(Level.Error, Subsystem.Ui, "Unhandled Exception: " + e.ExceptionObject.ToString()); if (e.IsTerminating) { Logger.system_is_crashing("Unhandled exception", e.ExceptionObject); } diff --git a/src/client/spark/uicore/NativeMethods/NativeMethods.cs b/src/client/spark/uicore/NativeMethods/NativeMethods.cs index c16afab84..5864dc06c 100644 --- a/src/client/spark/uicore/NativeMethods/NativeMethods.cs +++ b/src/client/spark/uicore/NativeMethods/NativeMethods.cs @@ -211,7 +211,7 @@ namespace mbts.ui.native // Since we want to do that during shutdown this could cause a long delay. bool result = SetWorkArea_SystemParametersInfo(SPI.SETWORKAREA, 1, rect, SPIF_UPDATEINIFILE); if (!result) { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "Failed to set work area. {0} - {1}".fmt(Marshal.GetLastWin32Error(), new System.ComponentModel.Win32Exception().Message)); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Failed to set work area. {0} - {1}".fmt(Marshal.GetLastWin32Error(), new System.ComponentModel.Win32Exception().Message)); } SendNotifyMessage(HWND_BROADCAST, WM.SETTINGCHANGE, (Int64)SPI.SETWORKAREA, 0); } diff --git a/src/client/spark/uicore/Settings/ISavedWindowFactory.cs b/src/client/spark/uicore/Settings/ISavedWindowFactory.cs index d2538e31d..5d6b77689 100644 --- a/src/client/spark/uicore/Settings/ISavedWindowFactory.cs +++ b/src/client/spark/uicore/Settings/ISavedWindowFactory.cs @@ -64,7 +64,7 @@ namespace mbts.ui.settings private async Task restore(string owner_name, byte[] state, WindowPosition windowPosition) { IShellModule owner = _modules.SingleOrDefault(m => m.key() == owner_name); if (owner == null) { - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Could not locate module '{0}'".fmt(owner_name)); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Could not locate module '{0}'".fmt(owner_name)); return null; } @@ -74,13 +74,13 @@ namespace mbts.ui.settings IShellWindow window = await task; if (window != null) { window.set_start_position(windowPosition); - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Restoring window {0} - {1}".fmt(owner_name, window.Title)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Restoring window {0} - {1}".fmt(owner_name, window.Title)); } return window; } } catch (Exception e) { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Failure to re-create window for module {0}. Error: {1}".fmt(owner_name, e.Message)); } return null; diff --git a/src/client/spark/uicore/Settings/ISettingsCollector.cs b/src/client/spark/uicore/Settings/ISettingsCollector.cs index 5cb48f12d..777a992bb 100644 --- a/src/client/spark/uicore/Settings/ISettingsCollector.cs +++ b/src/client/spark/uicore/Settings/ISettingsCollector.cs @@ -79,7 +79,7 @@ namespace mbts.ui.settings return state; } catch (Exception e) { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "Error saving window state for type {0}.\n {1}".fmt(window.GetType(), e.Message)); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Error saving window state for type {0}.\n {1}".fmt(window.GetType(), e.Message)); } return null; } diff --git a/src/client/spark/uicore/Shell/ShellModel.cs b/src/client/spark/uicore/Shell/ShellModel.cs index 1decc2169..28a0b139e 100644 --- a/src/client/spark/uicore/Shell/ShellModel.cs +++ b/src/client/spark/uicore/Shell/ShellModel.cs @@ -60,7 +60,7 @@ namespace mbts.ui private void PerformMEFComposition() { // Initialize MEF to populate Modules and windows - Logger.log(Level.Info, Subsystem.ui, "Beginning bts_shell module composition."); + Logger.log(Level.Info, Subsystem.Ui, "Beginning bts_shell module composition."); // Add specific instances Container.ComposeExportedValue(this); @@ -92,7 +92,7 @@ namespace mbts.ui private void InitInitializers() { foreach (IInitializable i in _initializers.OrderBy(i => i.priority)) { - Logger.log(Level.Info, Subsystem.ui, "Initializing {0} prority {1}".fmt(i.GetType().ToString(), i.priority)); + Logger.log(Level.Info, Subsystem.Ui, "Initializing {0} prority {1}".fmt(i.GetType().ToString(), i.priority)); i.initialize(); } } diff --git a/src/client/spark/uicore/Shell/Undo/UndoModel.cs b/src/client/spark/uicore/Shell/Undo/UndoModel.cs index 0bc5a5b97..87c3c1c14 100644 --- a/src/client/spark/uicore/Shell/Undo/UndoModel.cs +++ b/src/client/spark/uicore/Shell/Undo/UndoModel.cs @@ -44,7 +44,7 @@ namespace mbts.ui _undo(); } catch (Exception e) { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "Failed to undo : {0} - {1}".fmt(Name, e.ToString())); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Failed to undo : {0} - {1}".fmt(Name, e.ToString())); throw; } finally { diff --git a/src/client/spark/uicore/Shell/ViewLocator.cs b/src/client/spark/uicore/Shell/ViewLocator.cs index 3c2e1dd22..39b686535 100644 --- a/src/client/spark/uicore/Shell/ViewLocator.cs +++ b/src/client/spark/uicore/Shell/ViewLocator.cs @@ -36,12 +36,12 @@ namespace mbts.ui.shell private object create_view(T viewmodel) { string type_name = typeof(T).Name; - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Creating view for {0}".fmt(type_name)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Creating view for {0}".fmt(type_name)); // Check for an override Func factory; if (_overrides.TryGetValue(typeof(T), out factory)) { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Found OVERRIDE view for {0}".fmt(type_name)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Found OVERRIDE view for {0}".fmt(type_name)); var result = factory(); set_datacontext(viewmodel, result); return result; @@ -50,13 +50,13 @@ namespace mbts.ui.shell foreach (var view in Views) { if (view.Metadata.Model.Contains(typeof(T))) { var result = view.CreateExport().Value; - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Found {0} to view {1}".fmt(result.GetType(), type_name)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Found {0} to view {1}".fmt(result.GetType(), type_name)); result.DataContext = viewmodel; return result; } } - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Failed to find view for {0}".fmt(type_name)); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Failed to find view for {0}".fmt(type_name)); return null; } diff --git a/src/client/spark/uicore/Shell/Workspaces/WorkspacesModel.cs b/src/client/spark/uicore/Shell/Workspaces/WorkspacesModel.cs index 878739662..4d06743c9 100644 --- a/src/client/spark/uicore/Shell/Workspaces/WorkspacesModel.cs +++ b/src/client/spark/uicore/Shell/Workspaces/WorkspacesModel.cs @@ -65,20 +65,20 @@ namespace mbts.ui.shell if (initial_workspace == ACTIVE_WORKSPACE_NAME) { var localws = load_local_workspace(); if (localws != null) { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Loading workspace from disk"); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Loading workspace from disk"); await load_workspace(localws, position_shell: true); return; } } if (to_load != null) { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Loading initial workspace '{0}'".fmt(to_load.key)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Loading initial workspace '{0}'".fmt(to_load.key)); // Only load the launcher position if this is a private workspace await load_workspace(to_load.value, to_load.key, undo:false, position_shell: !to_load.value.is_shared); } else { // Show launcher at default position - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Showing launcher without loading initial workspace."); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Showing launcher without loading initial workspace."); _launcher.set_position(null); } } @@ -100,7 +100,7 @@ namespace mbts.ui.shell _wm.Windows.Clear(); task.Wait(TimeSpan.FromSeconds(90)); if (!task.IsCompleted) { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "Failed to save workspace during UI shutdown"); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Failed to save workspace during UI shutdown"); // The server is gone! Save the state to the local disk. save_workspace_locally(workspace); } @@ -122,7 +122,7 @@ namespace mbts.ui.shell } } catch { - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "The settings server is gone and I can't write to disk either. Shell is not having a good day."); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "The settings server is gone and I can't write to disk either. Shell is not having a good day."); } } private static WorkspaceDefinition load_local_workspace() { diff --git a/src/client/spark/uicore/Utility/ExpirationFormatter.cs b/src/client/spark/uicore/Utility/ExpirationFormatter.cs index 50b2c5d47..ed33f3b78 100644 --- a/src/client/spark/uicore/Utility/ExpirationFormatter.cs +++ b/src/client/spark/uicore/Utility/ExpirationFormatter.cs @@ -83,7 +83,7 @@ namespace mbts.ui.utility } catch (Exception ex) { - mbts.Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, String.Format("Exception message = {0}", ex.Message)); + mbts.Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, String.Format("Exception message = {0}", ex.Message)); } } diff --git a/src/client/spark/view/Controls/Badge.cs b/src/client/spark/view/Controls/Badge.cs index 039f12495..6a481dd9c 100644 --- a/src/client/spark/view/Controls/Badge.cs +++ b/src/client/spark/view/Controls/Badge.cs @@ -124,7 +124,7 @@ namespace mbts.ui.controls { var loc = e.GetPosition(this); var delta = loc - _drag_start; if (delta.Length > _min_drag_delta.Length) { - Logger.info(bts.log.Subsystem.ui, "Begin Drag"); + Logger.info(bts.log.Subsystem.Ui, "Begin Drag"); DragDrop.DoDragDrop(this, DataContext, DragDropEffects.Move|DragDropEffects.All); } } @@ -133,12 +133,12 @@ namespace mbts.ui.controls { protected override void OnMouseDown(MouseButtonEventArgs e) { base.OnMouseDown(e); CaptureMouse(); - Logger.info(bts.log.Subsystem.ui, "Mouse Down"); + Logger.info(bts.log.Subsystem.Ui, "Mouse Down"); } protected override void OnMouseUp(MouseButtonEventArgs e) { base.OnMouseUp(e); ReleaseMouseCapture(); - Logger.info(bts.log.Subsystem.ui, "Mouse Up"); + Logger.info(bts.log.Subsystem.Ui, "Mouse Up"); } #endregion } diff --git a/src/client/spark/view/Controls/Browser/BrowserWindow.cs b/src/client/spark/view/Controls/Browser/BrowserWindow.cs index f203ff830..7832f2c1d 100644 --- a/src/client/spark/view/Controls/Browser/BrowserWindow.cs +++ b/src/client/spark/view/Controls/Browser/BrowserWindow.cs @@ -141,7 +141,7 @@ namespace mbts.ui.controls } catch (Exception e) { - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Failed to register bts:// url extension. " + e.Message); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Failed to register bts:// url extension. " + e.Message); } } } diff --git a/src/client/spark/view/Converters/CellPathConverter.cs b/src/client/spark/view/Converters/CellPathConverter.cs index 60147999c..95eaa9a98 100644 --- a/src/client/spark/view/Converters/CellPathConverter.cs +++ b/src/client/spark/view/Converters/CellPathConverter.cs @@ -60,7 +60,7 @@ namespace mbts.ui.converters try { return _get_property(((IDataGridCellCollection)target).get_cell(key), remaining_path.Skip(1)); } catch (Exception ex) { - Logger.error(bts.log.Subsystem.ui, "CellPathConverter bad property lookup({0}): {1}.".fmt(key == null ? "null" : key, ex)); + Logger.error(bts.log.Subsystem.Ui, "CellPathConverter bad property lookup({0}): {1}.".fmt(key == null ? "null" : key, ex)); Logger.assert(false, "CellPathConverter bad property assert: {0}".fmt(ex)); return null; } diff --git a/src/client/spark/view/DragDrop/DragDropDocumentPreview.xaml.cs b/src/client/spark/view/DragDrop/DragDropDocumentPreview.xaml.cs index 07143ddbe..f2f1bd8b7 100644 --- a/src/client/spark/view/DragDrop/DragDropDocumentPreview.xaml.cs +++ b/src/client/spark/view/DragDrop/DragDropDocumentPreview.xaml.cs @@ -81,7 +81,7 @@ namespace mbts.ui.shell return bitmap; } else { - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Unexpected document type in TabDocument: {0}".fmt(document.Content.GetType())); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Unexpected document type in TabDocument: {0}".fmt(document.Content.GetType())); return Icons.Logo; } } diff --git a/src/client/spark/view/DragDrop/DragDropHelper.cs b/src/client/spark/view/DragDrop/DragDropHelper.cs index 9f1088643..e0cf43065 100644 --- a/src/client/spark/view/DragDrop/DragDropHelper.cs +++ b/src/client/spark/view/DragDrop/DragDropHelper.cs @@ -104,7 +104,7 @@ namespace mbts.ui try { var effect = DragDrop.DoDragDrop(_source, data, DragDropEffects.Move); } - catch (Exception error) { Logger.log(Level.Warn, Subsystem.ui, "Dragdrop failed: " + error.ToString()); } + catch (Exception error) { Logger.log(Level.Warn, Subsystem.Ui, "Dragdrop failed: " + error.ToString()); } show_document(_source, _source_window, true); _source = null; _source_window = null; diff --git a/src/client/spark/view/Extensions/Command/AsyncDialogCommand.cs b/src/client/spark/view/Extensions/Command/AsyncDialogCommand.cs index 3b7cd68d3..05ccbfe86 100644 --- a/src/client/spark/view/Extensions/Command/AsyncDialogCommand.cs +++ b/src/client/spark/view/Extensions/Command/AsyncDialogCommand.cs @@ -54,13 +54,13 @@ namespace mbts.ui if(w != null) try { w.Close(); w = null; } catch (Exception ex) { - Logger.warn(Subsystem.ui, "{0} error while attempting to Close window of Type {1} on Dispose: {2}".fmt(GetType(), typeof(TWindow), ex.Message)); + Logger.warn(Subsystem.Ui, "{0} error while attempting to Close window of Type {1} on Dispose: {2}".fmt(GetType(), typeof(TWindow), ex.Message)); } }); } } catch (Exception ex){ - Logger.warn(Subsystem.ui, "{0} error while attempting to launch window of type {1}: {2}".fmt(GetType(), typeof(TWindow), ex.Message)); + Logger.warn(Subsystem.Ui, "{0} error while attempting to launch window of type {1}: {2}".fmt(GetType(), typeof(TWindow), ex.Message)); } finally { _is_executing = false; diff --git a/src/client/spark/view/Resources/WindowStyle.xaml.cs b/src/client/spark/view/Resources/WindowStyle.xaml.cs index c5480b7f6..021b632f2 100644 --- a/src/client/spark/view/Resources/WindowStyle.xaml.cs +++ b/src/client/spark/view/Resources/WindowStyle.xaml.cs @@ -18,7 +18,7 @@ namespace mbts.ui window.Close(); } catch (Exception err) { - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "Exception closing window : {0}".fmt(err.ToString())); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "Exception closing window : {0}".fmt(err.ToString())); } } } diff --git a/src/client/spark/view/Shell/Login/LoginView.xaml.cs b/src/client/spark/view/Shell/Login/LoginView.xaml.cs index 7280c3bb6..0ab0b3d8a 100644 --- a/src/client/spark/view/Shell/Login/LoginView.xaml.cs +++ b/src/client/spark/view/Shell/Login/LoginView.xaml.cs @@ -62,7 +62,7 @@ namespace mbts.ui.shell } this.Activate(); handled = true; - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Login window brought to the foreground by attempt to re-launch the bts_shell."); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Login window brought to the foreground by attempt to re-launch the bts_shell."); } return IntPtr.Zero; } diff --git a/src/client/spark/view/Shell/ViewModels/ShellThreadFactory.cs b/src/client/spark/view/Shell/ViewModels/ShellThreadFactory.cs index 452924bbe..f3562dfa8 100644 --- a/src/client/spark/view/Shell/ViewModels/ShellThreadFactory.cs +++ b/src/client/spark/view/Shell/ViewModels/ShellThreadFactory.cs @@ -46,7 +46,7 @@ namespace mbts.ui.shell Logger.assert(false, e.ToString()); } finally { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Disposing slow {0} and cleaning up background thread.".fmt(name)); UIThreadData unused; _shared_threads.TryRemove(name, out unused); diff --git a/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs b/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs index 546142406..89c077841 100644 --- a/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs +++ b/src/client/spark/view/Shell/ViewModels/ShellWindowVM.cs @@ -92,7 +92,7 @@ namespace mbts.ui.shell } catch (Exception e) { error_text = e.Message; - Logger.log(bts.log.Level.Error, bts.log.Subsystem.ui, "Error getting window contents. " + e.ToString()); + Logger.log(bts.log.Level.Error, bts.log.Subsystem.Ui, "Error getting window contents. " + e.ToString()); } }, DispatcherPriority.Send); @@ -177,7 +177,7 @@ namespace mbts.ui.shell } else if (IsSlow) { // Terminating the background thread will dispose the model on that thread - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Beginning asyncronous dispose of slow window {0} .".fmt(_model.GetType().ToString())); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Beginning asyncronous dispose of slow window {0} .".fmt(_model.GetType().ToString())); _dispatcher.BeginInvokeShutdown(DispatcherPriority.Background); } else { diff --git a/src/client/spark/view/Shell/WindowManager.cs b/src/client/spark/view/Shell/WindowManager.cs index 03beb5b98..2283eaf0f 100644 --- a/src/client/spark/view/Shell/WindowManager.cs +++ b/src/client/spark/view/Shell/WindowManager.cs @@ -137,7 +137,7 @@ namespace mbts.ui.shell pos.host_id = window.host_id; return pos; } - Logger.log(bts.log.Level.Warn, bts.log.Subsystem.ui, "IShellWindow '{0}' does not have a valid position. It may not be displayed".fmt(shell_window.Title)); + Logger.log(bts.log.Level.Warn, bts.log.Subsystem.Ui, "IShellWindow '{0}' does not have a valid position. It may not be displayed".fmt(shell_window.Title)); return new WindowPosition(); } diff --git a/src/client/spark/view/Tests/WindowManagementTests.cs b/src/client/spark/view/Tests/WindowManagementTests.cs index ef1c36c50..14a8900b9 100644 --- a/src/client/spark/view/Tests/WindowManagementTests.cs +++ b/src/client/spark/view/Tests/WindowManagementTests.cs @@ -39,7 +39,7 @@ namespace mbts.ui.tests finally { gonow.Set(); } - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Init Application"); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Init Application"); Dispatcher.Run(); }); t.Name = "Application Thread"; @@ -53,7 +53,7 @@ namespace mbts.ui.tests [TearDown] public static void teardown() { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, ("Tear down Application")); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, ("Tear down Application")); if (Application.Current != null && Application.Current.Dispatcher != null) { Application.Current.Dispatcher.InvokeShutdown(); } @@ -69,7 +69,7 @@ namespace mbts.ui.tests Assert.IsNotNull(Application.Current); // Run the logic of this test on the "Main" thread Application.Current.Dispatcher.Invoke(() => { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Begin: test_windows_disposed"); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Begin: test_windows_disposed"); // Make sure that an IShellWindow and ISlowWindow added to the Windows collection is eventually disposed ObservableCollection windows = new ObservableCollection(); var thread_factory = new ShellThreadFactory(); @@ -95,7 +95,7 @@ namespace mbts.ui.tests public void test_slow_windows_disposed() { Assert.IsNotNull(Application.Current); Application.Current.Dispatcher.Invoke(() => { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Begin: test_slow_windows_disposed"); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Begin: test_slow_windows_disposed"); // Make sure that an IShellWindow and ISlowWindow added to the Windows collection is eventually disposed ObservableCollection windows = new ObservableCollection(); var thread_factory = new ShellThreadFactory(); diff --git a/src/client/spark/view/Utility/ScreenCapture.cs b/src/client/spark/view/Utility/ScreenCapture.cs index 9d00530e8..21e6d14c7 100644 --- a/src/client/spark/view/Utility/ScreenCapture.cs +++ b/src/client/spark/view/Utility/ScreenCapture.cs @@ -25,7 +25,7 @@ namespace mbts.ui.utility } public Stream capture_encoded(string format, int width, int height) { - Logger.log(bts.log.Level.Info, bts.log.Subsystem.ui, "Capturing screenshot ({0})".fmt(format)); + Logger.log(bts.log.Level.Info, bts.log.Subsystem.Ui, "Capturing screenshot ({0})".fmt(format)); BitmapEncoder encoder = get_encoder(format); BitmapSource bmp; diff --git a/src/client/spark_api/logging/Logger.cs b/src/client/spark_api/logging/Logger.cs index 344a481f0..f7b176f08 100644 --- a/src/client/spark_api/logging/Logger.cs +++ b/src/client/spark_api/logging/Logger.cs @@ -19,11 +19,21 @@ namespace bts.log { internal enum Subsystem { gen, + Config, + QBus, + Log, + Jetfix, + MarketData, + Api, + Persistence, + User, + OrderMan, + Latency, Assert, Engine, - ui, + Ui, Persist, - MarketData + // Please keep this list in sync with logging.h/logging.cpp } } diff --git a/src/lib/logging/logging.cpp b/src/lib/logging/logging.cpp index 0b4a51f93..d8bc21cd2 100644 --- a/src/lib/logging/logging.cpp +++ b/src/lib/logging/logging.cpp @@ -96,6 +96,10 @@ void configure_logging(bts::config::Logging const&cfg) {log::User,"User"}, {log::OrderMan,"OrderMan"}, {log::Latency,"Latency"}, + {log::Assert,"Assert"}, + {log::Engine,"Engine"}, + {log::Ui,"UI"}, + {log::Persist,"Persist"}, }; real_cfg.sinks["console"] = diff --git a/src/lib/logging/logging.h b/src/lib/logging/logging.h index c6673620b..2584f2930 100644 --- a/src/lib/logging/logging.h +++ b/src/lib/logging/logging.h @@ -33,6 +33,11 @@ constexpr log::Subsystem Persistence{Api.ordinal+1}; constexpr log::Subsystem User {Persistence.ordinal+1}; constexpr log::Subsystem OrderMan {User.ordinal+1}; constexpr log::Subsystem Latency {OrderMan.ordinal+1}; +constexpr log::Subsystem Assert {Latency.ordinal+1}; +constexpr log::Subsystem Engine {Assert.ordinal+1}; +constexpr log::Subsystem Ui {Engine.ordinal+1}; +constexpr log::Subsystem Persist {Ui.ordinal+1}; +// Please keep this list in sync with Logger.cs struct LoggerHandle { LoggerHandle(LoggerHandle const&) = delete;