本文整理汇总了Java中ch.qos.cal10n.MessageConveyor类的典型用法代码示例。如果您正苦于以下问题:Java MessageConveyor类的具体用法?Java MessageConveyor怎么用?Java MessageConveyor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MessageConveyor类属于ch.qos.cal10n包,在下文中一共展示了MessageConveyor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import ch.qos.cal10n.MessageConveyor; //导入依赖的package包/类
public static void main(String[] args) throws JoranException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
JoranConfigurator joranConfigurator = new JoranConfigurator();
joranConfigurator.setContext(context);
joranConfigurator.doConfigure("src/test/java/ch/qos/logback/classic/issue/DarioCampagna/logback-marker.xml");
IMessageConveyor mc = new MessageConveyor(Locale.getDefault());
LocLoggerFactory llFactory_default = new LocLoggerFactory(mc);
LocLogger locLogger = llFactory_default.getLocLogger("defaultLocLogger");
Marker alwaysMarker = MarkerFactory.getMarker("ALWAYS");
locLogger.info(alwaysMarker, "This will always appear.");
locLogger.info("Hello!");
}
示例2: IDSGenLogToolpack
import ch.qos.cal10n.MessageConveyor; //导入依赖的package包/类
/** 建立一个工具包。 */
public IDSGenLogToolpack()
{
訊息型態 = new MessageConveyor(Locale.TAIWAN);
記錄工具包 = new LocLoggerFactory(訊息型態);
}
示例3: LanguageController
import ch.qos.cal10n.MessageConveyor; //导入依赖的package包/类
/**
* Private constructor. The fallback language is set to English for all
* messages in nightingale.
*/
private LanguageController() {
conveyor = new MessageConveyor(new Locale("en"));
}
示例4: setLocale
import ch.qos.cal10n.MessageConveyor; //导入依赖的package包/类
/**
* Sets the current locale. This method actually resets the language
* conveyor in order to use the new locale.
* @param locale The new locale for localized messages through the language
* conveyor.
*/
public void setLocale(Locale locale) {
conveyor = new MessageConveyor(locale);
}