mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Merge branch 'fine-logging' into 'master'
Replace logging boilerplate with a static method See merge request akwizgran/briar!837
This commit is contained in:
@@ -32,8 +32,8 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.util.HtmlUtils.ARTICLE;
|
||||
|
||||
@@ -113,8 +113,7 @@ abstract class BaseControllerImpl extends DbControllerImpl
|
||||
long start = now();
|
||||
Collection<BlogPostHeader> headers =
|
||||
blogManager.getPostHeaders(groupId);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading headers took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading headers", start);
|
||||
Collection<BlogPostItem> items = new ArrayList<>(headers.size());
|
||||
start = now();
|
||||
for (BlogPostHeader h : headers) {
|
||||
@@ -122,8 +121,7 @@ abstract class BaseControllerImpl extends DbControllerImpl
|
||||
BlogPostItem item = getItem(h);
|
||||
items.add(item);
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading bodies took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading bodies", start);
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -141,8 +139,7 @@ abstract class BaseControllerImpl extends DbControllerImpl
|
||||
try {
|
||||
long start = now();
|
||||
BlogPostItem item = getItem(header);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading body took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading body", start);
|
||||
handler.onResult(item);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
@@ -167,8 +164,7 @@ abstract class BaseControllerImpl extends DbControllerImpl
|
||||
long start = now();
|
||||
BlogPostHeader header1 = getPostHeader(g, m);
|
||||
BlogPostItem item = getItem(header1);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading post took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading post", start);
|
||||
handler.onResult(item);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
|
||||
@@ -35,8 +35,8 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -161,8 +161,7 @@ class BlogControllerImpl extends BaseControllerImpl
|
||||
boolean ours = a.getId().equals(b.getAuthor().getId());
|
||||
boolean removable = blogManager.canBeRemoved(b);
|
||||
BlogItem blog = new BlogItem(b, ours, removable);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading blog took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading blog", start);
|
||||
handler.onResult(blog);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
@@ -180,8 +179,7 @@ class BlogControllerImpl extends BaseControllerImpl
|
||||
long start = now();
|
||||
Blog b = blogManager.getBlog(groupId);
|
||||
blogManager.removeBlog(b);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Removing blog took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Removing blog", start);
|
||||
handler.onResult(null);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.api.blog.BlogManager.CLIENT_ID;
|
||||
|
||||
@@ -110,10 +110,7 @@ class FeedControllerImpl extends BaseControllerImpl
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
}
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Loading all posts took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Loading all posts", start);
|
||||
handler.onResult(posts);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
@@ -130,9 +127,7 @@ class FeedControllerImpl extends BaseControllerImpl
|
||||
long start = now();
|
||||
Author a = identityManager.getLocalAuthor();
|
||||
Blog b = blogManager.getPersonalBlog(a);
|
||||
long duration = now() - start;
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading blog took " + duration + " ms");
|
||||
logDuration(LOG, "Loading personal blog", start);
|
||||
handler.onResult(b);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -59,8 +59,8 @@ import javax.inject.Inject;
|
||||
|
||||
import static android.support.v4.app.ActivityOptionsCompat.makeSceneTransitionAnimation;
|
||||
import static android.support.v4.view.ViewCompat.getTransitionName;
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.android.contact.ConversationActivity.CONTACT_ID;
|
||||
|
||||
@@ -209,8 +209,7 @@ public class ContactListFragment extends BaseFragment implements EventListener {
|
||||
// Continue
|
||||
}
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Full load took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Full load", start);
|
||||
displayContacts(revision, contacts);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -104,9 +104,9 @@ import uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt.PromptSt
|
||||
import static android.support.v4.view.ViewCompat.setTransitionName;
|
||||
import static android.support.v7.util.SortedList.INVALID_POSITION;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.android.activity.RequestCodes.REQUEST_INTRODUCTION;
|
||||
import static org.briarproject.briar.android.settings.SettingsFragment.SETTINGS_NAMESPACE;
|
||||
@@ -298,8 +298,7 @@ public class ConversationActivity extends BriarActivity
|
||||
contactName = contact.getAuthor().getName();
|
||||
contactAuthorId = contact.getAuthor().getId();
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading contact took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading contact", start);
|
||||
loadMessages();
|
||||
displayContactDetails();
|
||||
} catch (NoSuchContactException e) {
|
||||
@@ -358,10 +357,7 @@ public class ConversationActivity extends BriarActivity
|
||||
invitations.addAll(forumInvitations);
|
||||
invitations.addAll(blogInvitations);
|
||||
invitations.addAll(groupInvitations);
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Loading messages took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Loading messages", start);
|
||||
displayMessages(revision, headers, introductions, invitations);
|
||||
} catch (NoSuchContactException e) {
|
||||
finishOnUiThread();
|
||||
@@ -442,8 +438,7 @@ public class ConversationActivity extends BriarActivity
|
||||
try {
|
||||
long start = now();
|
||||
String body = messagingManager.getMessageBody(m);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading body took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading body", start);
|
||||
displayMessageBody(m, body);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
@@ -692,8 +687,7 @@ public class ConversationActivity extends BriarActivity
|
||||
try {
|
||||
long start = now();
|
||||
messagingManager.addLocalMessage(m);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Storing message took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Storing message", start);
|
||||
Message message = m.getMessage();
|
||||
PrivateMessageHeader h = new PrivateMessageHeader(
|
||||
message.getId(), message.getGroupId(),
|
||||
@@ -818,8 +812,7 @@ public class ConversationActivity extends BriarActivity
|
||||
try {
|
||||
long start = now();
|
||||
messagingManager.setReadFlag(g, m, true);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Marking read took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Marking read", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ import javax.inject.Inject;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.widget.Toast.LENGTH_LONG;
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.api.forum.ForumConstants.MAX_FORUM_NAME_LENGTH;
|
||||
|
||||
@@ -125,8 +125,7 @@ public class CreateForumActivity extends BriarActivity {
|
||||
try {
|
||||
long start = now();
|
||||
Forum f = forumManager.addForum(name);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Storing forum took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Storing forum", start);
|
||||
displayForum(f);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -44,8 +44,8 @@ import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static android.support.design.widget.Snackbar.LENGTH_INDEFINITE;
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.api.forum.ForumManager.CLIENT_ID;
|
||||
|
||||
@@ -169,8 +169,7 @@ public class ForumListFragment extends BaseEventFragment implements
|
||||
// Continue
|
||||
}
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Full load took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Full load", start);
|
||||
displayForums(revision, forums);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
@@ -196,10 +195,7 @@ public class ForumListFragment extends BaseEventFragment implements
|
||||
try {
|
||||
long start = now();
|
||||
int available = forumSharingManager.getInvitations().size();
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Loading available took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Loading available", start);
|
||||
displayAvailableForums(available);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
|
||||
@NotNullByDefault
|
||||
@@ -89,8 +89,7 @@ public class PasswordControllerImpl extends ConfigControllerImpl
|
||||
String encryptDatabaseKey(SecretKey key, String password) {
|
||||
long start = now();
|
||||
byte[] encrypted = crypto.encryptWithPassword(key.getBytes(), password);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Key derivation took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Key derivation", start);
|
||||
return StringUtils.toHexString(encrypted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.api.privategroup.PrivateGroupManager.CLIENT_ID;
|
||||
|
||||
@@ -162,8 +162,7 @@ class GroupListControllerImpl extends DbControllerImpl
|
||||
// Continue
|
||||
}
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading groups took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading groups", start);
|
||||
handler.onResult(items);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
@@ -178,8 +177,7 @@ class GroupListControllerImpl extends DbControllerImpl
|
||||
try {
|
||||
long start = now();
|
||||
groupManager.removePrivateGroup(g);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Removing group took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Removing group", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
handler.onException(e);
|
||||
|
||||
@@ -59,12 +59,12 @@ import static android.provider.Settings.EXTRA_CHANNEL_ID;
|
||||
import static android.provider.Settings.System.DEFAULT_NOTIFICATION_URI;
|
||||
import static android.support.v4.view.ViewCompat.LAYOUT_DIRECTION_LTR;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.api.plugin.BluetoothConstants.PREF_BT_ENABLE;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_NETWORK;
|
||||
import static org.briarproject.bramble.api.plugin.TorConstants.PREF_TOR_NETWORK_ALWAYS;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
|
||||
import static org.briarproject.briar.android.activity.RequestCodes.REQUEST_RINGTONE;
|
||||
@@ -249,10 +249,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
Settings btSettings = settingsManager.getSettings(BT_NAMESPACE);
|
||||
Settings torSettings =
|
||||
settingsManager.getSettings(TOR_NAMESPACE);
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Loading settings took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Loading settings", start);
|
||||
boolean btSetting =
|
||||
btSettings.getBoolean(PREF_BT_ENABLE, false);
|
||||
int torSetting = torSettings.getInt(PREF_TOR_NETWORK,
|
||||
@@ -440,10 +437,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
s.putInt(PREF_TOR_NETWORK, torSetting);
|
||||
long start = now();
|
||||
settingsManager.mergeSettings(s, TOR_NAMESPACE);
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Merging settings took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Merging settings", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
@@ -457,10 +451,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
s.putBoolean(PREF_BT_ENABLE, btSetting);
|
||||
long start = now();
|
||||
settingsManager.mergeSettings(s, BT_NAMESPACE);
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Merging settings took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Merging settings", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
@@ -472,10 +463,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
try {
|
||||
long start = now();
|
||||
settingsManager.mergeSettings(settings, SETTINGS_NAMESPACE);
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Merging settings took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Merging settings", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import java.util.Collection;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -98,10 +98,7 @@ public abstract class InvitationControllerImpl<I extends InvitationItem>
|
||||
try {
|
||||
long start = now();
|
||||
Collection<I> invitations = new ArrayList<>(getInvitations());
|
||||
if (LOG.isLoggable(FINE)) {
|
||||
long duration = now() - start;
|
||||
LOG.fine("Loading invitations took " + duration + " ms");
|
||||
}
|
||||
logDuration(LOG, "Loading invitations", start);
|
||||
handler.onResult(invitations);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -34,9 +34,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static java.util.logging.Level.FINE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.TimeUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.TimeUtils.now;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -135,8 +135,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
try {
|
||||
long start = now();
|
||||
G groupItem = loadNamedGroup();
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading group took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading group", start);
|
||||
handler.onResult(groupItem);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING))
|
||||
@@ -158,8 +157,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
// Load headers
|
||||
long start = now();
|
||||
Collection<H> headers = loadHeaders();
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading headers took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading headers", start);
|
||||
|
||||
// Load bodies into cache
|
||||
start = now();
|
||||
@@ -169,8 +167,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
loadMessageBody(header));
|
||||
}
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Loading bodies took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Loading bodies", start);
|
||||
|
||||
// Build and hand over items
|
||||
handler.onResult(buildItems(headers));
|
||||
@@ -200,8 +197,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
for (I i : items) {
|
||||
markRead(i.getId());
|
||||
}
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Marking read took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Marking read", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
}
|
||||
@@ -218,8 +214,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
long start = now();
|
||||
H header = addLocalMessage(msg);
|
||||
bodyCache.put(msg.getMessage().getId(), body);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Storing message took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Storing message", start);
|
||||
resultHandler.onResult(buildItem(header, body));
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
@@ -238,8 +233,7 @@ public abstract class ThreadListControllerImpl<G extends NamedGroup, I extends T
|
||||
long start = now();
|
||||
G groupItem = loadNamedGroup();
|
||||
deleteNamedGroup(groupItem);
|
||||
if (LOG.isLoggable(FINE))
|
||||
LOG.fine("Removing group took " + (now() - start) + " ms");
|
||||
logDuration(LOG, "Removing group", start);
|
||||
} catch (DbException e) {
|
||||
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
handler.onException(e);
|
||||
|
||||
Reference in New Issue
Block a user