Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Log() is inaccessible

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Log() is inaccessible

    In 6.5 I would write to the Log if something very unexpected & unwanted was detected by the indicator code. This is not working in NT7. The Log() command is still in the help file, it is not mentioned in the changes PDF, and I did not find any mention in the forum of it changing.

    These error messages are shown when compiling :
    'System.Diagnostics.Log' is inaccessible due to its protection level
    'System.Diagnostics.Log' is a 'type', which is not valid in the given context

    The code is the same as in 6.5:
    Log("message", NinjaTrader.Cbi.LogLevel.Information);

    I tried explicitly referencing System.Diagnostics.Log() but that did not help.
    How do I get it to work in NT7 (Beta 19)?

    #2
    Hello,

    Thank you for your forum post.

    Someone will respond on Monday.

    Thank you for your patience.

    Comment


      #3
      LostTrader, please try for example Log("Message", LogLevel.Information);
      BertrandNinjaTrader Customer Service

      Comment


        #4
        exact same errors, Bertrand.

        Comment


          #5
          Can you please attach your test script, the command works for me fine in NT7 B19 here. Thanks.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Now that you say that, I realized that one other indicator already converted from 6.5 also had a log stmt & it was fine. Seems there were two reasons for the errors:

            1. an explicit function call to System.Diagnostics.Log() does not work (??)
            2. the 2nd instance was in a static function, apparently it does not work there at all. :-(

            Bummer, it would be useful if the log & print commands would work in static functions for trace & debug.

            Comment


              #7
              Thanks for those suggestions - perhaps you can send me the indicator where you experience this to support at ninjatrader dot com Attn Bertrand (can strip any custom IP). Thanks
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by haas88, 03-21-2024, 02:22 AM
              18 responses
              208 views
              0 likes
              Last Post haas88
              by haas88
               
              Started by Board game geek, Today, 02:20 AM
              0 responses
              2 views
              0 likes
              Last Post Board game geek  
              Started by knighty6508, Today, 01:20 AM
              2 responses
              14 views
              0 likes
              Last Post knighty6508  
              Started by franatas, Today, 01:53 AM
              0 responses
              3 views
              0 likes
              Last Post franatas  
              Started by knighty6508, Today, 01:17 AM
              0 responses
              9 views
              0 likes
              Last Post knighty6508  
              Working...
              X