Changeset 3a22ce7 in sasview


Ignore:
Timestamp:
Oct 6, 2016 11:22:29 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0639476
Parents:
280f929
Message:

Add timestamp to console messages. Fixes #637

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/gui_statusbar.py

    rd85c194 r3a22ce7  
    66import sys 
    77import logging 
     8import datetime 
    89from wx import StatusBar as wxStatusB 
    910from wx.lib import newevent 
     
    4647 
    4748        self.msg_txt.SetEditable(False) 
    48         self.msg_txt.SetValue('No message available') 
     49        timestamp = datetime.datetime.now() 
     50        status = '{:%Y-%m-%d %H:%M:%S} : No message available'.format(timestamp) 
     51        self.msg_txt.SetValue(status) 
    4952        self.sizer.Add(self.msg_txt, 1, wx.EXPAND|wx.ALL, 10) 
    5053        self.SetSizer(self.sizer) 
     
    6063        if status.strip() == "": 
    6164            return 
     65        # Add timestamp 
     66        timestamp = datetime.datetime.now() 
     67        status = '{:%Y-%m-%d %H:%M:%S} : '.format(timestamp) + status 
    6268        color = (0, 0, 0) #black 
    6369        icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 
Note: See TracChangeset for help on using the changeset viewer.