Book a Demo

Author Topic: log levels in JScript-Logging and VBScript-Logging  (Read 4404 times)

Heidi V.

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
log levels in JScript-Logging and VBScript-Logging
« on: April 23, 2015, 01:08:21 am »
There seems to be a mistake in the scripts JScript-Logging and VBScript-Logging in the EAScriptLib folder. Or at least general programming conventions are not followed (see e.g. https://logging.apache.org/log4j/2.x/manual/customloglevels.html or http://stackoverflow.com/questions/7839565/logging-levels-logback-rule-of-thumb-to-assign-log-levels).

The scripts say:
Code: [Select]
LOGLEVEL_ERROR = 0
LOGLEVEL_INFO = 1
LOGLEVEL_WARNING = 2
LOGLEVEL_DEBUG = 3
LOGLEVEL_TRACE = 4

The issue here is that warning is lower than info. Meaning that, if the level is set to LOGLEVEL_INFO, then warning messages are not displayed in the output.

I would the levels expect to be as follows:
Code: [Select]
LOGLEVEL_ERROR = 0
LOGLEVEL_WARNING = 1
LOGLEVEL_INFO = 2
LOGLEVEL_DEBUG = 3
LOGLEVEL_TRACE = 4

So I guess my question is, is this a bug (then I'll report it) or a feature?

Heidi V.

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: log levels in JScript-Logging and VBScript-Log
« Reply #1 on: July 24, 2015, 06:50:41 pm »
Reply received from Sparx:
Quote
Thanks for your feedback.  At this stage we are not going to consider changing the meaning/order of the log levels due to potential impact that it may have on existing users.
 
If you wanted to change the ordering yourself however you could simply copy this script from EAScriptLib, adjust to your liking and then reference it from your own scripts.

Note: the ordering can also be changed by including the original script and changing the ordering in the scripts including it:
Code: [Select]
var LOGLEVEL_INFO = 2;
var LOGLEVEL_WARNING = 1;