本文整理匯總了Java中org.jboss.logging.Logger.info方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.info方法的具體用法?Java Logger.info怎麽用?Java Logger.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.logging.Logger
的用法示例。
在下文中一共展示了Logger.info方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testNothing
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void testNothing() {
Logger gouda = Logger.getLogger( "cheese.gouda" );
gouda.info( "gouda info" );
gouda.debug( "gouda debug");
assertTrue( gouda.isTraceEnabled() );
assertTrue( gouda.isDebugEnabled() );
assertTrue( gouda.isInfoEnabled() );
Logger cheddar = Logger.getLogger( "cheese.cheddar" );
cheddar.info( "cheddar info" );
cheddar.debug( "cheddar debug" );
assertFalse( cheddar.isTraceEnabled() );
assertFalse( cheddar.isDebugEnabled() );
assertFalse( cheddar.isInfoEnabled() );
}
示例2: doLogging
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void doLogging() throws FileNotFoundException {
String message = "testing: " + UUID.randomUUID().toString();
Logger logger = Logger.getLogger("br.org.sistemafieg.cliente");
logger.info(message);
assertTrue("File not found: " + logFile, new File(logFile).exists());
BufferedReader reader = new BufferedReader(new FileReader(logFile));
List<String> lines = reader.lines().collect(Collectors.toList());
boolean found = false;
for (String line : lines) {
if (line.contains(message)) {
found = true;
break;
}
}
assertTrue("Expected message " + message, found);
}
示例3: testNothing
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void testNothing() {
Logger gouda = Logger.getLogger( "cheese.gouda" );
gouda.info( "gouda info" );
gouda.debug( "gouda debug");
assertFalse( gouda.isTraceEnabled() );
assertFalse( gouda.isDebugEnabled() );
assertTrue( gouda.isInfoEnabled() );
Logger cheddar = Logger.getLogger( "cheese.cheddar" );
cheddar.info( "cheddar info" );
cheddar.debug( "cheddar debug" );
assertFalse( cheddar.isTraceEnabled() );
assertFalse( cheddar.isDebugEnabled() );
assertTrue( cheddar.isInfoEnabled() );
}
示例4: main
import org.jboss.logging.Logger; //導入方法依賴的package包/類
public static void main(String[] args) throws MalformedURLException {
// 2. Specify the alternate log manager as a system property
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
// 3. Specify a system property point to logging.properties(optional, if not set, a configuration locator will find 'logging.properties' in the class path)
String propUrl = JBossLoggingExample.class.getClassLoader().getResource("logging.properties").toString();
System.out.println(propUrl);
System.setProperty("logging.configuration", propUrl);
// 4. Initialize a Logger
Logger logger = Logger.getLogger(JBossLoggingExample.class);
// 5. logging the message
logger.trace("TRACE Message");
logger.debug("DEBUG Message");
logger.info("INFO Message");
logger.warn("WARN Message");
logger.error("Error Message");
logger.fatal("FATAL Message");
}
示例5: main
import org.jboss.logging.Logger; //導入方法依賴的package包/類
public static void main(String[] args) throws IOException {
// 2. Specify the alternate log manager as a system property
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
// 3. Configure Programmtically
String logLevel = "TRACE";
String logFile = "target/jboss-logging-programmtically.log";
PropertyConfigurator configurator = new PropertyConfigurator();
configurator.configure(createLogManagerConfig(logLevel, logFile));
// 4. Initialize a Logger
Logger logger = Logger.getLogger(JBossLoggingExample.class);
// 5. logging the message
logger.trace("TRACE Message");
logger.debug("DEBUG Message");
logger.info("INFO Message");
logger.warn("WARN Message");
logger.error("Error Message");
logger.fatal("FATAL Message");
}
示例6: testCustomCategory
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void testCustomCategory() {
Logger logger = Logger.getLogger("custom.category");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertFalse(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例7: testCustomCategoryChildren
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void testCustomCategoryChildren() {
Logger logger = Logger.getLogger("custom.category.children.Something");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertFalse(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例8: testRoot
import org.jboss.logging.Logger; //導入方法依賴的package包/類
@Test
public void testRoot() {
Logger logger = Logger.getLogger("");
logger.info("gouda info");
logger.debug("gouda debug");
logger.trace("gouda trace");
assertTrue(logger.isTraceEnabled());
assertTrue(logger.isDebugEnabled());
assertTrue(logger.isInfoEnabled());
}
示例9: logSwitchYardVersions
import org.jboss.logging.Logger; //導入方法依賴的package包/類
/**
* Logs each Version returned by {@link #getSwitchYardVersions()}.
* @param logger the Logger to log to
*/
public static void logSwitchYardVersions(Logger logger) {
if (logger.isInfoEnabled()) {
for (Version version : getSwitchYardVersions()) {
logger.info(version);
}
}
}
示例10: logSwitchYardNotification
import org.jboss.logging.Logger; //導入方法依賴的package包/類
/**
* Logs the SwitchYard notification returned by {@link #getSwitchYardNotification()}.
* @param logger the Logger to log to
*/
public static void logSwitchYardNotification(Logger logger) {
if (logger.isInfoEnabled()) {
logger.info(getSwitchYardNotification());
}
}