Problem with printing logMessages

Legacy User
Legacy User New Altair Community Member
edited November 5 in Community Q&A
Hello RapidMiners,

I have a problem with the log system, i.e. I do not seem to understand it :) I created a plugin which is based on GeneticAlgorithm,java. in my copied GenticAlgorithm file I can put out log message with logNote(""xxx"). The class returns a "PopulationOperator" for Muatation (used within AbstractGeneticAlgorithm) which I exchanged for my own Operator, however I am not able to log any messages from MyMutationOperator (looks very much like SelectionMuatation.java). I tried:

LogService.getGlobal().setVerbosityLevel(LogService.MAXIMUM);
LogService.getGlobal().log("--------",LogService.NOTE);
but this doesn't print any Statements on RapidMiners console. I DO know that the code is excecuted because System.out.out.printlns come through.

Any sugesstions?

Thanks

Answers

  • land
    land New Altair Community Member
    Hi Sebastian,
    if I understood you right, you implemented another operator? Then you will use it within an process. If you click on the the root of the process there is a parameter "logverbosity", did you changed the value apropriate to your verbosity used within your operator?

    Greetings,
      Sebastian
  • Legacy User
    Legacy User New Altair Community Member
    Hi,
    thanks for answering. Yes I think I did implement a new operator, however my understanding about RapidMiner still leaves something to be desired. A few days ago I started writing a plugin without having any knowledge about RapidMiner whatsoever :)

    To understand the situation perhaps you might take a look at the provided example 05_Features/11_Evolutionary Feature_Selection

    There is an Element "GeneticAlgorithm" (a FeatureOperator)from within that I can print Log Messages ("Notes"), now GeneticAlgorithm does something like new SelectionCrossover(crossoverType, pCrossover, getRandom(), minNumber, maxNumber, exactNumber); with "SelectionMuation" being an "Individual Operator". This Operator cannot be seen in RapidMiners Operator Tree, since I assume it is somehow "internal" to GeneticAlgortihm. From within Selection Mutation I found no way of printing messages to the log.

    I tried, as you suggested, playing with "logverbostiy" of the "Root-Process" element, but this didn't help.

    Any suggestions or pointers to relevant documentation?


  • IngoRM
    IngoRM New Altair Community Member
    Hi,

    LogService.getGlobal().setVerbosityLevel(LogService.MAXIMUM);
    LogService.getGlobal().log("--------",LogService.NOTE);
    the problem is the first line. This will set the global LogService to a mode where only the most important messages (those with a verbosity level of MAXIMUM) will be logged at all. NOTE is lower than MAXIMUM, therefore it will not be shown. The solution is quite easy: just skip the first line and use only the second, i.e.

    LogService.getGlobal().log("--------",LogService.NOTE);
    Hope that helps,
    Ingo
  • Legacy User
    Legacy User New Altair Community Member
    Ah ok thank you. Somehow I've been understanding the LogLevels the other way around. I am still not entirely sure whether it works as intended now, but at least I get some log messages through and will figure the rest out :)