static void withErrorsLogged(Action action) { try { action(); } catch (Exception e) { LogC.err("exception caught from timer", e); } }
public void testLogStackTrace() { try { throw new Exception("outer", new NullReferenceException("inner")); } catch (Exception e) { LogC.err("logc err", e); } }
static void handleEachError <T>(IEnumerable <T> items, int i, T current, Exception e) { var currentStr = "tostring failed."; try { currentStr = current.ToString(); } catch (Exception tose) { LogC.err("tostring on item failed", tose); } throw Bomb.toss("failed@" + i + ", processing: " + currentStr + " in " + toShortString(items), e); }
[SetUp] public void setUpWithTeardown() { try { LogC.consoleOut("setUpWithTeardown"); LogC.setOut("setup " + this, null, false); LogC.setVerboseLoggingForever(true); LogC.info("Starting " + this); Log.info("Starting " + this); setUp(); } catch { try { tearDown(); } catch (Exception e) { LogC.err("failed in teardown after failing in setup! ", e); } throw; } }
public static void err(string s) { LogC.err(s); }