This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 175985 - API for easy usage logging
Summary: API for easy usage logging
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Logger (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: API
Depends on:
Blocks: 147458 172913
  Show dependency tree
 
Reported: 2009-11-03 23:37 UTC by Jesse Glick
Modified: 2012-02-01 17:10 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-11-03 23:37:09 UTC
http://wiki.netbeans.org/UsageLoggingSpecification is pretty cumbersome - a lot of things to copy and paste, with no
easy way to tell if you are doing it right. Would much prefer to have an API class somewhere (preferably in platform
cluster so it can be used even from e.g. org.openide.text.Installer) which would have a method like

public static void logUsage(String subcategory, String key, Class caller, Object... params);

where subcategory would be an optional sublogger name within org.netbeans.ui.metrics (is this really used for
anything??), key would be the usual log record message (would be forced to start with "USG_"), caller would be used to
locate a Bundle.properties (or could we just hardcode nonlocalized strings?), and params would be the data of interest.

Also suggest a helper method to cluster larger numeric values into buckets, e.g.

    private static String someOrMany(int count) {
        if (count < 10) {
            return Integer.toString(count);
        } else {
            return "~e^" + Math.round(Math.log(count));
        }
    }
Comment 1 Jaroslav Tulach 2009-11-04 08:03:06 UTC
I am not really sure this is necessary (thus the decrease in priority), but if it shall be implemented then let's do 
it in uihandler module and let's move the module (or its API part) into the platform.

Here is the current API that could be enhanced:
http://bits.netbeans.org/dev/javadoc/org-netbeans-lib-uihandler/overview-summary.html