當前位置: 首頁>>代碼示例>>Java>>正文


Java Logging類代碼示例

本文整理匯總了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();
}
 
開發者ID:gerard-bisama,項目名稱:DHIS2-fhir-lab-app,代碼行數:37,代碼來源:MediatorMain.java

示例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());
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:13,代碼來源:CoffeeHouseApp.java

示例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();
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:11,代碼來源:QuarantinedMonitorActorTest.java

示例4: CoffeeHouseApp

import akka.event.Logging; //導入依賴的package包/類
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:6,代碼來源:CoffeeHouseApp.java

示例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);
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:4,代碼來源:BaseAkkaTestCase.java

示例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);
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-with-akka,代碼行數:4,代碼來源:BaseAkkaTestCase.java

示例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);
}
 
開發者ID:ironfish,項目名稱:oreilly-reactive-architecture-old,代碼行數:4,代碼來源:BaseAkkaTestCase.java


注:本文中的akka.event.Logging類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。