java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.helpers.ConfigLoggingHelper
Helper for logging configuration page rendering and form processing.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LogManagerThe router's log manager.private static final StringBundle with the core's translated strings.private static final String[]These are translated in the core bundle.Fields inherited from class HelperBase
_context, _log, _out, CHECKED, PROP_ADVANCED, SELECTEDModifier and TypeFieldDescriptionprotected RouterContextThe router context.protected LogThe log instance.protected WriterThe writer for output.static final StringChecked attribute for HTML checkboxes.static final StringProperty key for advanced mode.static final StringSelected attribute for HTML select options.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprivate StringTranslate a string from the core bundle.Retrieve the current log date format pattern.Generate the HTML select box for the default log level.Whether log compression is enabled.Retrieve the current log file pattern.private voidgetLogLevelBox(StringBuilder buf, String name, String cur, boolean showRemove) Appends the select box choosing a logger's level.Generate the HTML table for configuring log levels by class/package.Retrieve the maximum log file size.All the classes the log manager knows about, except ones that already have overrides.Retrieve the current log record format pattern.voidsetContextId(String contextId) Re-fetch the log manager for the new context.Methods inherited from class HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, storeWriterModifier and TypeMethodDescriptionTranslate a string.Translate a string with a parameter.Translate a string with two parameters.static StringMark a string for extraction by xgettext and translation.protected StringgetChecked(String prop) Get the checked attribute for a boolean property.booleanCheck if advanced mode is enabled.Translate a string with plural forms (ngettext).voidstoreWriter(Writer out) Store the writer for output.
Field Details
_mgr
The router's log manager.levels
These are translated in the core bundle.CORE_BUNDLE_NAME
Bundle with the core's translated strings.- See Also:
Constructor Details
ConfigLoggingHelper
public ConfigLoggingHelper()Create a new helper for logging configuration.
Method Details
setContextId
Re-fetch the log manager for the new context.- Overrides:
setContextIdin classHelperBase- Parameters:
contextId- beginning few characters of the routerHash, or null to pick the first one we come across.
getLogFilePattern
Retrieve the current log file pattern.- Returns:
- the base log filename pattern
getRecordPattern
Retrieve the current log record format pattern.- Returns:
- the format pattern string
getDatePattern
Retrieve the current log date format pattern.- Returns:
- the date format pattern
getMaxFileSize
Retrieve the maximum log file size.- Returns:
- the max file size as a formatted string (e.g. "1.00 MiB")
getLogCompress
Whether log compression is enabled.- Returns:
- the CHECKED constant if compression is enabled, empty string otherwise
getLogLevelTable
Generate the HTML table for configuring log levels by class/package.- Returns:
- the HTML string for the log level table
getDefaultLogLevelBox
Generate the HTML select box for the default log level.- Returns:
- the HTML string for the select box
getLogLevelBox
Appends the select box choosing a logger's level.- Parameters:
buf- where the control is appendedname- the control's namecur- the level now in useshowRemove- whether to offer removing the entry
getNewClassBox
All the classes the log manager knows about, except ones that already have overrides.- Returns:
- the HTML string for the new class selection box
_c