mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FUS: add documentation for fus logger
This commit is contained in:
+30
@@ -4,6 +4,22 @@ package com.intellij.internal.statistic.eventLog
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* An entrypoint class to record in event log an information about feature usages.
|
||||
*
|
||||
* There are two types of events:
|
||||
* 1) Regular events, recorded when they occur, e.g. open project, invoked action;
|
||||
* 2) State events, should be recorded regularly by scheduler, e.g. configured libraries/frameworks;
|
||||
*
|
||||
* Each event might be recorded together with an additional (context) information, e.g. source and shortcut for action.
|
||||
*
|
||||
* Note: FeatureUsageCollector API use this class under the hood.
|
||||
* Therefore, if you record statistic with FeatureUsageCollector API there's no need to record events in event log manually.
|
||||
*
|
||||
* @see com.intellij.internal.statistic.service.fus.collectors.FeatureUsagesCollector
|
||||
* @see com.intellij.internal.statistic.service.fus.collectors.ApplicationUsageTriggerCollector
|
||||
* @see com.intellij.internal.statistic.service.fus.collectors.ProjectUsageTriggerCollector
|
||||
*/
|
||||
object FeatureUsageLogger {
|
||||
private val ourLogger : FeatureUsageEventLogger
|
||||
|
||||
@@ -16,18 +32,32 @@ object FeatureUsageLogger {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Records that in a group with 'recorderId' (e.g. 'dialogs', 'intentions') a new event occurred.
|
||||
*/
|
||||
fun log(recorderId: String, action: String) {
|
||||
return ourLogger.log(recorderId, action, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* Records that in a group with 'recorderId' (e.g. 'dialogs', 'intentions') a new event occurred.
|
||||
* Adds context information to the event, e.g. source and shortcut for an action.
|
||||
*/
|
||||
fun log(recorderId: String, action: String, data: Map<String, Any>) {
|
||||
return ourLogger.log(recorderId, action, data, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* Records a new state event in a group with 'recorderId' (e.g. 'run.configuration.type').
|
||||
*/
|
||||
fun logState(recorderId: String, action: String) {
|
||||
return ourLogger.log(recorderId, action, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Records a new state event in a group with 'recorderId' (e.g. 'run.configuration.type').
|
||||
* Adds context information to the event, e.g. if configuration is stored on project or on IDE level.
|
||||
*/
|
||||
fun logState(recorderId: String, action: String, data: Map<String, Any>) {
|
||||
return ourLogger.log(recorderId, action, data, true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user