Not logged in
Viewing 3 posts - 1 through 3 (of 3 total)
  • #114065 |
    Customer
    256 Posts

    Hi SQ Team,

     

     

    could you give us a little introduction about how to debug or print data in quant editor

     

     

    There are TestOutput, SQUtils classes where are  methods which i expect are ready for this. Could you give us a short examples ?

     

    Many Thanks

     

    Clonex 

     

    #132474
    Mark Fric
    Administrator
    1182 Posts

    I assume you want to log the data from snippets, right?

    The easiest way is to use the build-in logging engine, it will then log your messages directly to the log file.

     

    How to do it:

     

    1. add two imports (or use Fix Imports after step 2.):

    import org.slf4j.LoggerFactory;
    import org.slf4j.Logger;
     
    2. add static final variable Log to the begining of any class, like this:
     
    public class SQDefault extends OverviewTemplate {
        public static final Logger Log = LoggerFactory.getLogger(“name of logger”);
     
     
    3. then you can use functions like:
    Log.info(“your message”);
    Log.debug(“your mesage”+number);
     
    anywhere in the class, and the message will be writen to the QA log file.
     
     
    You made a good point that it should be easier and beter documented to do this, we’ll add more documentation and better features for it in the new update.

    Mark
    StrategyQuant architect

    #132476
    Customer
    256 Posts

    I assume you want to log the data from snippets, right?
    The easiest way is to use the build-in logging engine, it will then log your messages directly to the log file.

    How to do it:

    1. add two imports (or use Fix Imports after step 2.):
    import org.slf4j.LoggerFactory;
    import org.slf4j.Logger;

    2. add static final variable Log to the begining of any class, like this:

    public class SQDefault extends OverviewTemplate {
    public static final Logger Log = LoggerFactory.getLogger(“name of logger”);

    3. then you can use functions like:
    Log.info(“your message”);
    Log.debug(“your mesage”+number);

    anywhere in the class, and the message will be writen to the QA log file.

    You made a good point that it should be easier and beter documented to do this, we’ll add more documentation and better features for it in the new update.

    Many thanks!

    Odoslané z SM-G900F pomocou Tapatalku

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.