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.
    BrettNinjaTrader Product Management

    Comment


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

      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.

          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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              602 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              347 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              559 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X