How to use the pomelo-logger.getLogger function in pomelo-logger

To help you get started, we’ve selected a few pomelo-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NetEase / pomelo-rpc / lib / rpc-server / acceptors / ws-acceptor.js View on Github external
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var utils = require('../../util/utils');
var WebSocketServer = require('ws').Server;
var logger = require('pomelo-logger').getLogger('pomelo-rpc', __filename);
var Tracer = require('../../util/tracer');

var Acceptor = function(opts, cb){
  EventEmitter.call(this);
  this.bufferMsg = opts.bufferMsg;
  this.interval = opts.interval;  // flush interval in ms
  this.rpcDebugLog = opts.rpcDebugLog;
  this.rpcLogger = opts.rpcLogger;
  this.whitelist = opts.whitelist;
  this._interval = null;          // interval object
  this.sockets = {};
  this.msgQueues = {};
  this.cb = cb;
  this.socketId = 0;

  // Heartbeat ping interval.
github NetEase / pomelo-rpc / lib / rpc-server / acceptors / tcp-acceptor.js View on Github external
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var utils = require('../../util/utils');
var net = require('net');
var Composer = require('../../util/composer');
var Tracer = require('../../util/tracer');
var logger = require('pomelo-logger').getLogger('pomelo-rpc', __filename);

var MSG_TYPE = 0;
var PING = 1;
var PONG = 2;
var RES_TYPE = 3;

var Acceptor = function(opts, cb) {
  EventEmitter.call(this);
  opts = opts || {};
  this.bufferMsg = opts.bufferMsg;
  this.interval = opts.interval;  // flush interval in ms
  this.pkgSize = opts.pkgSize;
  this._interval = null;          // interval object
    // Heartbeat ping interval.
  this.ping = 'ping' in opts ? opts.ping : 25e3;
github NetEase / pomelo / lib / components / remote.js View on Github external
module.exports = function(app, opts) {
  opts = opts || {};

  // cacheMsg is deprecated, just for compatibility here.
  opts.bufferMsg = opts.bufferMsg || opts.cacheMsg || false;
  opts.interval = opts.interval || 30;
  if(app.enabled('rpcDebugLog')) {
    opts.rpcDebugLog = true;
    opts.rpcLogger = require('pomelo-logger').getLogger('rpc-debug', __filename);
  }
  return new Component(app, opts);
};
github NetEase / pomelo / lib / components / proxy.js View on Github external
module.exports = function(app, opts) {
  opts = opts || {};
  // proxy default config
  // cacheMsg is deprecated, just for compatibility here.
  opts.bufferMsg = opts.bufferMsg || opts.cacheMsg || false;
  opts.interval = opts.interval || 30;
  opts.router = genRouteFun();
  opts.context = app;
  opts.routeContext = app;
  if (app.enabled('rpcDebugLog')) {
    opts.rpcDebugLog = true;
    opts.rpcLogger = require('pomelo-logger').getLogger('rpc-debug', __filename);
  }

  return new Component(app, opts);
};
github NetEase / pomelo-admin / lib / modules / nodeInfo.js View on Github external
/*!
 * Pomelo -- consoleModule nodeInfo processInfo
 * Copyright(c) 2012 fantasyni 
 * MIT Licensed
 */
var monitor = require('pomelo-monitor');
var logger = require('pomelo-logger').getLogger('pomelo-admin', __filename);

var DEFAULT_INTERVAL = 5 * 60;		// in second
var DEFAULT_DELAY = 10;						// in second

module.exports = function(opts) {
	return new Module(opts);
};

module.exports.moduleId = 'nodeInfo';

var Module = function(opts) {
	opts = opts || {};
	this.type = opts.type || 'pull';
	this.interval = opts.interval || DEFAULT_INTERVAL;
	this.delay = opts.delay || DEFAULT_DELAY;
};
github rain1017 / quick-pomelo / test / area / index.js View on Github external
'use strict';

var should = require('should');
var logger = require('pomelo-logger').getLogger('test', __filename);
var Q = require('q');

var Area = require('../../app/components/area');

describe('area test', function(){
	it('invoke', function(cb){

		var area = new Area({_id : 'area1'});
		area.test('arg');

		cb(null);
	});
});
github rain1017 / quick-pomelo / test / units / area-proxy.js View on Github external
'use strict';

var env = require('../env');
var Q = require('q');
var sinon = require('sinon');
var util = require('util');
var logger = require('pomelo-logger').getLogger('test', __filename);

describe('areaProxy test', function(){
	before(env.before);
	beforeEach(env.beforeEach);
	afterEach(env.afterEach);
	after(env.after);

	it('area proxy test', function(cb){
		var app = env.createMockApp('server1', 'area');

		var method = 'testInvoke';
		var args = ['arg1', 'arg2'];

		Q.nfcall(function(cb){
			return app.start(cb);
		}).then(function(){
github rain1017 / quick-pomelo / test / units / area.js View on Github external
'use strict';

var env = require('../env');
var Q = require('q');
var util = require('util');
var logger = require('pomelo-logger').getLogger('test', __filename);

describe('area test', function(){
	before(env.before);
	beforeEach(env.beforeEach);
	afterEach(env.afterEach);
	after(env.after);

	it('create/remove/join/quit/login/logout/notify player', function(cb){
		var connectorId = 'connector-server-1';
		var areaId = 'area1';
		var playerId = 'player1';

		var app1 = env.createMockApp('server1', 'area');
		var app2 = env.createMockApp('server2', 'area');

		Q.fcall(function(){
github rain1017 / quick-pomelo / test / area-proxy / index.js View on Github external
'use strict';

var env = require('../env');
var Q = require('q');
var sinon = require('sinon');
var logger = require('pomelo-logger').getLogger('test', __filename);

var AreaManager = require('../../app/components/area-manager');
var AreaProxy = require('../../app/components/area-proxy');

describe('area-proxy test', function(){
	before(env.before);
	beforeEach(env.beforeEach);
	afterEach(env.afterEach);
	after(env.after);

	it('areaProxy test', function(cb){
		var fakeAreaServer = {
			invokeArea : sinon.spy()
		};
		var fakeApp = {
			rpc : {	area :
github rain1017 / quick-pomelo / test / units / player-backend.js View on Github external
'use strict';

var env = require('../env');
var Q = require('q');
var util = require('util');
var logger = require('pomelo-logger').getLogger('test', __filename);

describe('playerBackend test', function(){
	before(env.before);
	beforeEach(env.beforeEach);
	afterEach(env.afterEach);
	after(env.after);

	it('create/acquire/release player', function(cb){
		var serverId = 'area-server-1';
		var areaId = 'area1';
		var playerId = 'player1';

		var app = env.createMockApp(serverId, 'area');

		Q.nfcall(function(cb){
			app.start(cb);

pomelo-logger

pomelo-logger ========

Unknown
Latest version published 10 years ago

Package Health Score

31 / 100
Full package analysis

Popular pomelo-logger functions

Similar packages