Exemplo n.º 1
0
 def test_mute_unmute(self):
     Logger.set_console_level(LogLevel.DEBUG)
     self.assertIsNotNone(Logger.CONSOLE_LEVEL)
     Logger.mute()
     self.assertEqual(Logger.CONSOLE_LEVEL, LogLevel.CRITICAL)
     Logger.unmute()
     self.assertEqual(Logger.CONSOLE_LEVEL, LogLevel.DEBUG)
Exemplo n.º 2
0
def do_metadata(args):
    wid = args.wid
    Logger.mute()
    if wid == "*":
        tasks = ConfigManager.manager().taskDB.get_all_tasks()
        for t in tasks:
            try:
                print("--- TASKID = " + t.wid + " ---")
                ConfigManager.manager().from_wid(
                    t.wid, readonly=True).log_dbtaskinfo()
            except Exception as e:
                print("\tAn error occurred: " + str(e))
    else:
        tm = ConfigManager.manager().from_wid(wid)
        tm.log_dbtaskinfo()
    Logger.unmute()
def do_metadata(args):
    wid = args.wid
    Logger.mute()
    cm = ConfigManager(db_path=None)
    if wid == "*":
        tasks = cm._taskDB.get_all_tasks()
        for t in tasks:
            try:
                print("--- TASKID = " + t.wid + " ---")
                cm.get_from_path_or_submission(t.wid,
                                               readonly=True).log_dbtaskinfo()
            except Exception as e:
                print("\tAn error occurred: " + str(e))
    else:
        tm = cm.get_from_path_or_submission(wid, readonly=True)
        tm.log_dbtaskinfo()
    Logger.unmute()