Event listener

@param self
@param msg
547890
function notification_event_listener (self, msg) {

	//debug.log('msg = ', msg);

	self._events.emit('$notification', msg);

	//msg = {
	//  name: 'notification',
	//  length: 70,
	//  processId: 1707,
	//  channel: 'tcn',
	//  payload: '"documents",I,"id"=\'0c402f6f-8126-5dc3-a4df-20035bc8304d\''
	//}

	/* Parse notification and emit again correctly */
	let channel = msg && msg.channel || undefined;
	let payload = msg && msg.payload || undefined;
	//debug.log(
	//	'channel = ', channel, '\n',
	//	'payload = ', payload
	//);

	if ( (payload.charAt(0) !== '[') ) {
		self._events.emit(channel, payload);
		return;
	}

	let parsed_payload;
	try {
		parsed_payload = JSON.parse(payload);
	} catch(e) {
		self._events.emit(channel, payload);
		return;
	}
	//debug.log('parsed_payload = ', parsed_payload);
	if (is.array(parsed_payload)) {
		self._events.emit.apply(self._events, [channel].concat(parsed_payload));
	} else {
		self._events.emit.apply(self._events, [channel].concat([parsed_payload]));
	}
}
1311224
public static void d(String tag, String msg) {
        if (logger != null && isLoggingEnabled(tag, DEBUG)) {
            logger.d(tag, msg);
        }
    }
298179
public void messageReceived (MessageEvent event)
    {
        if (_msghandlers != null) {
            MessageHandler handler = _msghandlers.get(event.getName());
            if (handler != null) {
                handler.handleEvent(event, this);
            }
        }

        // If the message is directed at us, see if it's a request for a method invocation
        if (event.isPrivate()) { // aka if (event instanceof ServerMessageEvent)
            // the first argument should be the client object of the caller or null if it is
            // a server-originated event
            int srcoid = event.getSourceOid();
            DObject source = (srcoid <= 0) ? null : _omgr.getObject(srcoid);
            String method = event.getName();
            Object[] args = event.getArgs(), nargs;

            // validate that this call is allowed
            if (!allowManagerCall(method)) {
                log.warning("Client tried to invoke forbidden manager call!",
                    "source", source, "method", method, "args", args);
                return;
            }

            if (args == null) {
                nargs = new Object[] { source };
            } else {
                nargs = new Object[args.length+1];
                nargs[0] = source;
                System.arraycopy(args, 0, nargs, 1, args.length);
            }

            // Lazily create our dispatcher now that it's actually getting a message
            if (_dispatcher == null) {
                Class<?> clazz = getClass();
                MethodFinder finder = _dispatcherFinders.get(clazz);
                if (finder == null) {
                    finder = new MethodFinder(clazz);
                    _dispatcherFinders.put(clazz, finder);
                }
                _dispatcher = new DynamicListener<DSet.Entry>(this, finder);
            }
            _dispatcher.dispatchMethod(method, nargs);
        }
    }
1230643
@Override
    protected void trace(String msg, Object... args) {
        msg = S.fmt(msg, args);
        if (once) {
            msg = S.builder("[once]").append(msg).toString();
        }
        super.trace(msg);
    }
339056
public void debug(String msg) {
        if (!logger.isDebugEnabled())
            return;

        if (instanceofLAL) {
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, msg, null, null);
        } else {
            logger.debug(msg);
        }
    }
1136930
public static void logEvent(final StructuredDataMessage msg) {
        LOGGER.logIfEnabled(FQCN, Level.OFF, EVENT_MARKER, msg, null);
    }
129276
public void appendMsg(final String msg) {
        if (!EventQueue.isDispatchThread()) {
            try {
                EventQueue.invokeAndWait(new Runnable() {

                    @Override
                    public void run() {
                        appendMsg(msg);
                    }
                });
            } catch (InvocationTargetException e) {
                LOGGER.error("Failed to append message: ", e);
            } catch (InterruptedException ignore) {
            }
            return;
        }

        displayRandomTip();
        getLogPanel().append(msg);
        JScrollBar vertical = getLogJScrollPane().getVerticalScrollBar();
        vertical.setValue(vertical.getMaximum());
    }
193478
public void warning(String msg) {
        if (Level.WARNING.intValue() < levelValue) {
            return;
        }
        log(Level.WARNING, msg);
    }
1312845
static void log(Object targetObj, String msg) {
        if (EventsParams.isDebug()) {
            Log.d(TAG, toLogStr(targetObj, msg));
        }
    }
169734
public void log(int level, String msg, String extra) {
		if (logLevel >= level) {
			messageListener.debug(msg + extra);
		}
	}
1291772
private void notifyListenersAfterWrite(ModbusMessage msg) {
        synchronized (listeners) {
            for (AbstractSerialTransportListener listener : listeners) {
                listener.afterMessageWrite(commPort, msg);
            }
        }
    }
486969
public void error(final String msg) {
        if (proxy.isErrorEnabled()) {
            if (proxy instanceof LocationAwareLogger) {
                ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.ERROR_INT, msg, null, null);
            } else {
                proxy.error(msg);
            }
        }
    }
540528
public void d(final String msg) {
        logMgr.log(tag, LogLevelConst.DEBUG, msg, null);
    }
17604
public static void i(String tag, String msg) {
        if (logger != null && isLoggingEnabled(tag, INFO)) {
            logger.i(tag, msg);
        }
    }
649354
function (msg,verbosity)
		{
			if (!_debug || verbosity>_verbosity)
				return false;
			this.e.log.apply(this,[msg||'','debug',verbosity||0]);
			return self;
		}
1172772
public static void i(String tag, String msg) {
        if (sLevel > LEVEL_INFO) {
            return;
        }
        Log.i(tag, msg);
    }
201183
private void runMessage(MessageAmp msg)
  {
    try (OutboxAmp outbox = OutboxAmpFactory.newFactory().get()) {
      outbox.inbox(msg.inboxTarget());
      outbox.message(msg);
      
      //RampActor systemActor = null;
      StubAmp systemActor = _stub;
      
      msg.invoke(InboxExecutorBase.this, systemActor);
      
      while (! outbox.flushAndExecuteLast()) {
      }
    }
  }