• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ILogNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mendix.logging.ILogNode的典型用法代码示例。如果您正苦于以下问题:Java ILogNode类的具体用法?Java ILogNode怎么用?Java ILogNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILogNode类属于com.mendix.logging包,在下文中一共展示了ILogNode类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: log

import com.mendix.logging.ILogNode; //导入依赖的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: publish

import com.mendix.logging.ILogNode; //导入依赖的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


示例3: executeAction

import com.mendix.logging.ILogNode; //导入依赖的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


示例4: executeAction

import com.mendix.logging.ILogNode; //导入依赖的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


示例5: testGetConnection

import com.mendix.logging.ILogNode; //导入依赖的package包/类
@Test
public void testGetConnection() throws SQLException {
  ILogNode logger = Mockito.mock(ILogNode.class);
  ConnectionManager manager = newConnManager(logger);

  Connection conn1 = manager.getConnection(jdbcUrl, userName, password);
  Mockito.verify(logger, times(3)).trace(anyString()); // One log message is printed in JdbcConnectionManager.initializeDrivers.
  conn1.close();

  Connection conn2 = manager.getConnection(jdbcUrl, userName, password);
  Mockito.verify(logger, times(4)).trace(anyString());
  conn2.close();

  assertNotEquals(conn1, conn2);
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:16,代码来源:ConnectionManagerTest.java


示例6: overlayPdf

import com.mendix.logging.ILogNode; //导入依赖的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


示例7: MqttConnector

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public MqttConnector(ILogNode logger) {
    this.logger = logger;
    if (mqttHandlers == null) {
        mqttHandlers = new HashMap();
    }
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:7,代码来源:MqttConnector.java


示例8: MxMqttCallback

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public MxMqttCallback(ILogNode logger, MqttClient client, HashMap<String, MqttSubscription> subscriptions) {
    this.logger = logger;
    this.client = client;
    this.subscriptions = subscriptions;
}
 
开发者ID:ako,项目名称:MqttClient,代码行数:6,代码来源:MxMqttCallback.java


示例9: RedshiftClusterOperations

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public RedshiftClusterOperations(ILogNode logNode) {
  this.logNode = logNode;
  createRedShiftClient();
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:5,代码来源:RedshiftClusterOperations.java


示例10: OperationBlocker

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public OperationBlocker(Supplier<Boolean> isReady, Long sleepTimeInSeconds, ILogNode logNode, String name) {
  this.logNode = logNode;
  this.sleepTime = sleepTimeInSeconds;
  this.name = name;
  this.isBusy = isReady;
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:7,代码来源:OperationBlocker.java


示例11: blockUntilReady

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public static void blockUntilReady(Supplier<Boolean> isBusy, Long sleepTimeInSeconds, ILogNode logNode, String name) {
  new OperationBlocker(isBusy, sleepTimeInSeconds, logNode, name).blockUntilReady();
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:4,代码来源:OperationBlocker.java


示例12: newConnManager

import com.mendix.logging.ILogNode; //导入依赖的package包/类
private ConnectionManager newConnManager(final ILogNode logNode) {
  return new JdbcConnectionManager(logNode);
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:4,代码来源:ConnectionManagerTest.java


示例13: JdbcConnectionManager

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public JdbcConnectionManager(final ILogNode logNode) {
  this.logNode = logNode;
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:4,代码来源:JdbcConnectionManager.java


示例14: JdbcConnector

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public JdbcConnector(final ILogNode logNode, final ObjectInstantiator objectInstantiator, final ConnectionManager connectionManager) {
  this.logNode = logNode;
  this.objectInstantiator = objectInstantiator;
  this.connectionManager = connectionManager;
}
 
开发者ID:mendix,项目名称:database-connector,代码行数:6,代码来源:JdbcConnector.java


示例15: getLogger

import com.mendix.logging.ILogNode; //导入依赖的package包/类
public static ILogNode getLogger(String name)
{
	return component.core().getLogger(name);
}
 
开发者ID:Finaps,项目名称:BootstrapCarousel,代码行数:5,代码来源:Core.java


示例16: overlayPdf

import com.mendix.logging.ILogNode; //导入依赖的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
 */
public static boolean overlayPdf(IContext context, IMendixObject generatedDocumentMendixObject, IMendixObject overlayMendixObject) throws IOException {	
	ILogNode logger = Core.getLogger("OverlayPdf"); 
	logger.trace("Retrieve generated document");
	PDDocument inputDoc = PDDocument.load(Core.getFileDocumentContent(context, generatedDocumentMendixObject));
	
	logger.trace("Overlay PDF start, retrieve overlay PDF");
	PDDocument overlayDoc = PDDocument.load(Core.getFileDocumentContent(context, overlayMendixObject));
			
	logger.trace("Perform overlay");
	Overlay overlay = new Overlay();
	overlay.setInputPDF(inputDoc);
	overlay.setDefaultOverlayPDF(overlayDoc);
	overlay.setOverlayPosition(Overlay.Position.BACKGROUND);
	
	logger.trace("Save result in output stream");
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	overlay.overlay(new HashMap<Integer, String>()).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();
	inputDoc.close();
	
	logger.trace("Overlay PDF end");
	return true;
}
 
开发者ID:mendix,项目名称:RestServices,代码行数:40,代码来源:Misc.java


示例17: overlayPdf

import com.mendix.logging.ILogNode; //导入依赖的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
 */
public static boolean overlayPdf(IContext context, IMendixObject generatedDocumentMendixObject, IMendixObject overlayMendixObject, boolean onTopOfContent) throws IOException {	
	ILogNode logger = Core.getLogger("OverlayPdf"); 
	logger.trace("Retrieve generated document");
	PDDocument inputDoc = PDDocument.load(Core.getFileDocumentContent(context, generatedDocumentMendixObject));
	
	logger.trace("Overlay PDF start, retrieve overlay PDF");
	PDDocument overlayDoc = PDDocument.load(Core.getFileDocumentContent(context, overlayMendixObject));
			
	logger.trace("Perform overlay");
	Overlay overlay = new Overlay();
	overlay.setInputPDF(inputDoc);
	overlay.setDefaultOverlayPDF(overlayDoc);
	if (onTopOfContent == true){
		overlay.setOverlayPosition(Overlay.Position.FOREGROUND);
	} else {
		overlay.setOverlayPosition(Overlay.Position.BACKGROUND);
	}
	
	logger.trace("Save result in output stream");
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	overlay.overlay(new HashMap<Integer, String>()).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();
	inputDoc.close();
	
	logger.trace("Overlay PDF end");
	return true;
}
 
开发者ID:mendix,项目名称:CommunityCommons,代码行数:44,代码来源:Misc.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockFluid类代码示例发布时间:2022-05-22
下一篇:
Java CircuitBreaker类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap