当前位置: 首页>>代码示例>>Java>>正文


Java Core.getLogger方法代码示例

本文整理汇总了Java中com.mendix.core.Core.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Java Core.getLogger方法的具体用法?Java Core.getLogger怎么用?Java Core.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mendix.core.Core的用法示例。


在下文中一共展示了Core.getLogger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: log

import com.mendix.core.Core; //导入方法依赖的package包/类
public static void log(String lognode, LogLevel loglevel, String message, Throwable e) {
	ILogNode logger = Core.getLogger(lognode);
	switch (loglevel) {
	case Critical:
		logger.critical(message,e);
		break;
	case Warning:
		logger.warn(message,e);
		break;
	case Debug:
		logger.debug(message);
		break;
	case Error:
		logger.error(message,e);
		break;
	case Info:
		logger.info(message);
		break;
	case Trace:
		logger.trace(message);
		break;			
	}
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:24,代码来源:Logging.java

示例2: ConversationLog

import com.mendix.core.Core; //导入方法依赖的package包/类
/**
 * Create a new conversion
 * @param M2ee loglevel to report to
 * @param Log message of the first section that will be created
 */
public ConversationLog(String lognode, String firstSection) {
	this.log = Core.getLogger(lognode);
	id = conversationNumber.incrementAndGet();
	
	section(firstSection);
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:12,代码来源:ConversationLog.java

示例3: publish

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public void publish(LogRecord record)
{
	/*
	  @see java.util.logging.Level;
	  public static final Level OFF = new Level("OFF", 2147483647, defaultBundle);
	  public static final Level SEVERE = new Level("SEVERE", 1000, defaultBundle);
	  public static final Level WARNING = new Level("WARNING", 900, defaultBundle);
	  public static final Level INFO = new Level("INFO", 800, defaultBundle);
	  public static final Level CONFIG = new Level("CONFIG", 700, defaultBundle);
	  public static final Level FINE = new Level("FINE", 500, defaultBundle);
	  public static final Level FINER = new Level("FINER", 400, defaultBundle);
	  public static final Level FINEST = new Level("FINEST", 300, defaultBundle);
	  public static final Level ALL = new Level("ALL", -2147483648, defaultBundle);
	 */
	if (record.getLevel() == Level.OFF || record.getLevel() == Level.ALL) //These loglevels should not be used inside a log record
		return;
	
	ILogNode logNode = Core.getLogger(record.getLoggerName());
	int loglevel = record.getLevel().intValue();
	
	if (loglevel < Level.INFO.intValue() && !logNode.isDebugEnabled())
		return;
	if (loglevel < Level.FINER.intValue() && !logNode.isTraceEnabled())
		return;
		
	Throwable ex = record.getThrown();
	if (loglevel < Level.FINER.intValue())
		logNode.trace(record.getMessage(), ex);
	else if (loglevel < Level.INFO.intValue())
		logNode.debug(record.getMessage(), ex);
	else if (ex != null)
		logNode.error(record.getMessage(), ex);
	else
		logNode.info(record.getMessage());
}
 
开发者ID:mendix,项目名称:IBM-Watson-Connector-Suite,代码行数:37,代码来源:CommonsLoggingListener.java

示例4: executeAction

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
	// BEGIN USER CODE
	//throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");
	MqttConnector handler = new MqttConnector(Core.getLogger("MqttConnector"));
	return true;
	// END USER CODE
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:10,代码来源:MqttInitialize.java

示例5: executeAction

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
	// BEGIN USER CODE
       ILogNode logger = Core.getLogger("MqttConnector");
       try {
           MqttConnector handler = new MqttConnector(logger);
           logger.info(String.format("Unsubscribe: %s", this.TopicName));
           handler.unsubscribe(this.BrokerHost, this.BrokerPort, this.TopicName);
           return true;
       } catch (Exception e) {
           return false;
       }
	// END USER CODE
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:16,代码来源:MqttUnsubscribe.java

示例6: executeAction

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
	// BEGIN USER CODE
       ILogNode logger = Core.getLogger("MqttConnector");
       try {
           MqttConnector handler = new MqttConnector(logger);
           logger.info(String.format("subscribe: %s", this.TopicName));
           handler.subscribe(this.BrokerHost, this.BrokerPort, this.BrokerOrganisation, this.TopicName, this.OnMessageMicroflow, this.CA, this.ClientCertificate, this.ClientKey, this.CertificatePassword, this.Username, this.Password);
           return true;
       } catch (Exception e) {
           return false;
       }
	// END USER CODE
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:16,代码来源:MqttSubscribe.java

示例7: executeAction

import com.mendix.core.Core; //导入方法依赖的package包/类
@Override
public java.lang.Boolean executeAction() throws Exception
{
	// BEGIN USER CODE
       MqttConnector handler = new MqttConnector(Core.getLogger("MqttConnector"));
       try {
           handler.publish(this.BrokerHost, this.BrokerPort, this.BrokerOrganisation,this.TopicName, this.Payload, this.CA, this.ClientCertificate, this.ClientKey, this.CertificatePassword, this.Username, this.Password);
           return true;
       } catch (Exception e) {
           return false;
       }
	// END USER CODE
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:14,代码来源:MqttPublish.java

示例8: overlayPdf

import com.mendix.core.Core; //导入方法依赖的package包/类
/**
 * Overlay a generated PDF document with another PDF (containing the company stationary for example)
 * @param context
 * @param generatedDocumentMendixObject The document to overlay
 * @param overlayMendixObject The document containing the overlay
 * @return boolean
 * @throws IOException
 * @throws COSVisitorException
 */
public static boolean overlayPdf(IContext context, IMendixObject generatedDocumentMendixObject, IMendixObject overlayMendixObject) throws IOException, COSVisitorException {
	
	ILogNode logger = Core.getLogger("OverlayPdf"); 
	logger.trace("Overlay PDF start, retrieve overlay PDF");
	PDDocument overlayDoc = PDDocument.load(Core.getFileDocumentContent(context, overlayMendixObject));
	int overlayPageCount = overlayDoc.getNumberOfPages();
	PDPage lastOverlayPage = (PDPage)overlayDoc.getDocumentCatalog().getAllPages().get(overlayPageCount - 1);

	logger.trace("Retrieve generated document");
	PDDocument offerteDoc = PDDocument.load(Core.getFileDocumentContent(context, generatedDocumentMendixObject));

	int pageCount = offerteDoc.getNumberOfPages();
	if (logger.isTraceEnabled()) {
		logger.trace("Number of pages in overlay: " + overlayPageCount + ", in generated document: " + pageCount);						
	}
	if (pageCount > overlayPageCount) {
		logger.trace("Duplicate last overlay page to match number of pages");
		for (int i = overlayPageCount; i < pageCount; i++) {
			overlayDoc.importPage(lastOverlayPage);
		}
	} else if (overlayPageCount > pageCount) {
		logger.trace("Delete unnecessary pages from the overlay to match number of pages");
		for (int i = pageCount; i < overlayPageCount; i++) {
			overlayDoc.removePage(i);
		}
	}
			
	logger.trace("Perform overlay");
	Overlay overlay = new Overlay();
	overlay.overlay(offerteDoc,overlayDoc);
	
	logger.trace("Save result in output stream");
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	overlayDoc.save(baos);
	
	logger.trace("Duplicate result in input stream");
	InputStream overlayedContent = new ByteArrayInputStream(baos.toByteArray());
	
	logger.trace("Store result in original document");
	Core.storeFileDocumentContent(context, generatedDocumentMendixObject, overlayedContent);
	
	logger.trace("Close PDFs");
	overlayDoc.close();
	offerteDoc.close();
	
	logger.trace("Overlay PDF end");
	return true;
	
}
 
开发者ID:appronto,项目名称:RedisConnector,代码行数:59,代码来源:Misc.java

示例9: JdbcConnectionManager

import com.mendix.core.Core; //导入方法依赖的package包/类
public JdbcConnectionManager() {
  this(Core.getLogger(JdbcConnectionManager.class.getName()));
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:4,代码来源:JdbcConnectionManager.java


注:本文中的com.mendix.core.Core.getLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。