Varargs logging.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@791 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-12-09 19:29:18 +00:00
parent 7148e78405
commit b1a74708f0
@@ -121,7 +121,7 @@ public class StatRepository extends DepotRepository
updateStat(playerId, stats[ii], true); updateStat(playerId, stats[ii], true);
} }
} catch (Exception e) { } catch (Exception e) {
log.warning("Error flushing modified stat [stat=" + stats[ii] + "].", e); log.warning("Error flushing modified stat", "stat", stats[ii], e);
} }
} }
} }
@@ -138,8 +138,7 @@ public class StatRepository extends DepotRepository
try { try {
code = assignStringCode(type, value); code = assignStringCode(type, value);
} catch (DatabaseException pe) { } catch (DatabaseException pe) {
log.warning("Failed to assign code [type=" + type + log.warning("Failed to assign code", "type", type, "value", value, pe);
", value=" + value + "].", pe);
// at this point the database is probably totally hosed, so we can just punt here, // at this point the database is probably totally hosed, so we can just punt here,
// and assume that this value will never be persisted // and assume that this value will never be persisted
code = -1; code = -1;
@@ -299,27 +298,23 @@ public class StatRepository extends DepotRepository
return code; return code;
} catch (DatabaseException pe) { } catch (DatabaseException pe) {
// if this is not a duplicate row exception, something is booched and we // if this is not a duplicate row exception, something is booched and we just fail
// just fail
if (!(pe instanceof DuplicateKeyException)) { if (!(pe instanceof DuplicateKeyException)) {
throw pe; throw pe;
} }
// if it is a duplicate row exception, possibly someone inserted our value // if it is a duplicate row exception, possibly someone inserted our value before
// before we could, in which case we can just look up the new mapping // we could, in which case we can just look up the new mapping
StringCodeRecord record = load( StringCodeRecord record = load(
StringCodeRecord.class, StringCodeRecord.getKey(type.code(), value)); StringCodeRecord.class, StringCodeRecord.getKey(type.code(), value));
if (record != null) { if (record != null) {
log.info("Value collision assigning string code [type=" + type + log.info("Value collision assigning string code", "type", type, "value", value);
", value=" + value + "].");
return code; return code;
} }
// otherwise someone used the code we were trying to use and we just need // otherwise someone used the code we were trying to use and we just need to loop
// to loop around and get the next highest code // around and get the next highest code
log.info("Code collision assigning string code [type=" + type + log.info("Code collision assigning string code", "type", type, "value", value);
", value=" + value + "].");
} }
} }
throw new DatabaseException( throw new DatabaseException(