本文整理匯總了Java中akka.event.Logging類的典型用法代碼示例。如果您正苦於以下問題:Java Logging類的具體用法?Java Logging怎麽用?Java Logging使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Logging類屬於akka.event包,在下文中一共展示了Logging類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import akka.event.Logging; //導入依賴的package包/類
public static void main(String... args) throws Exception {
//setup actor system
final ActorSystem system = ActorSystem.create("mediator");
//setup logger for main
final LoggingAdapter log = Logging.getLogger(system, "main");
//setup actors
log.info("Initializing mediator actors...");
String configPath = null;
if (args.length==2 && args[0].equals("--conf")) {
configPath = args[1];
log.info("Loading mediator configuration from '" + configPath + "'...");
} else {
log.info("No configuration specified. Using default properties...");
}
MediatorConfig config = loadConfig(configPath);
final MediatorServer server = new MediatorServer(system, config);
//setup shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
log.info("Shutting down mediator");
server.stop();
system.shutdown();
}
});
log.info("Starting mediator server...");
server.start();
log.info(String.format("%s listening on %s:%s", config.getName(), config.getServerHost(), config.getServerPort()));
Thread.currentThread().join();
}
示例2: CoffeeHouseApp
import akka.event.Logging; //導入依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
this.system = system;
log = Logging.getLogger(system, getClass().getName());
coffeeHouse = createCoffeeHouse();
//===========================================================================
// ANSWER
//===========================================================================\
// @todo send "Brew Coffee" to coffeeHouse
// @todo use ActorRef.noSender() as the sender
// coffeeHouse.tell("Brew Coffee", ActorRef.noSender());
}
示例3: testOnReceiveAnother
import akka.event.Logging; //導入依賴的package包/類
@Test
public void testOnReceiveAnother() throws Exception {
final Address local = Address.apply("http", "local");
final Address remote = Address.apply("http", "remote");
final Throwable t = new RuntimeException("Another exception");
final InvalidAssociation cause = InvalidAssociation.apply(local, remote, t, Option.apply(null));
final AssociationErrorEvent event = new AssociationErrorEvent(cause, local, remote, true, Logging.ErrorLevel());
actor.tell(event, ActorRef.noSender());
verify(callback, never()).apply();
}
示例4: CoffeeHouseApp
import akka.event.Logging; //導入依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
this.system = system;
log = Logging.getLogger(system, getClass().getName());
coffeeHouse = createCoffeeHouse();
}
示例5: interceptInfoLogMessage
import akka.event.Logging; //導入依賴的package包/類
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
示例6: interceptErrorLogMessage
import akka.event.Logging; //導入依賴的package包/類
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
示例7: interceptDebugLogMessage
import akka.event.Logging; //導入依賴的package包/類
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}