Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Request for LoggerInterface example for Python

    Cinema 4D SDK
    3
    7
    714
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • indexofrefractionI
      indexofrefraction
      last edited by ferdinand

      hi ...

      so, does this ConsolePrint() example print immediately?

      i guess it is not possible use it for a dialog, but...
      it should be possible to print into a custom logger channel?
      (i've seen a plugin doing that)

      would it be possible to get an example how to use
      LoggerInterface.AddNewLogger ?

      the goal would be to add a console channel for a cmd plugin
      and to "live" output console messages to that channel
      while the plugin is processing one of its commands.
      it would also be nice to share that channel for all my plugins
      and to have a way to to open (show) and clear the console
      before processing

      best, index

      EDIT:
      i tried to port the C++ example to python...
      https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_loggerinterface.html
      but i fail with
      myLogger.AddLoggerType(maxon.TARGETAUDIENCE.ALL, maxon.LoggerTypes.Application)
      --> TypeError: unable to convert maxon.interface.Declaration to @net.maxon.interface.class-cR

      (sorry this is probably a bit off topic and should be in a separate thread)

      edit [ferdinand]: This thread is a follow up question for the thread Write to C4D console in real time.

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by

        Hi @indexofrefraction,

        I have forked your posting, because it warrants a new thread as you already said yourself. We will answer your questions in the next days, I just moved the thread for now.

        Thank you for your understanding,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • indexofrefractionI
          indexofrefraction
          last edited by indexofrefraction

          Thanks Ferdinand,

          right, its good to have this separated from the old thread.

          there are two objectives mixed in here :

          1. know how to get and use a separate console channel
          2. get immediate output to a console or dialog (if that is possible)
          1 Reply Last reply Reply Quote 0
          • M
            m_adam
            last edited by

            Hi @indexofrefraction unfortunately this is not possible to implement your own interface within Python.
            See Maxon API Introduction - Interface.

            So I would rather recommend you to take a look at the Python logging module.

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • indexofrefractionI
              indexofrefraction
              last edited by indexofrefraction

              tx adam, i just want a new "private" channel in the console window
              (apart from "Default", "Python", "Renderer" and "Team Render")
              to separate the log of my plugins from the normal chit-chat ...

              Wouldn't a new instance of an existing interface (type) be enough for that?
              (a reference to the normal python channel with a new name?)

              1 Reply Last reply Reply Quote 0
              • M
                m_adam
                last edited by

                Hi @indexofrefraction, sorry for the late reply I completely overlooked your reply.

                Unfortually no, this is not possible at the moment, if you want to do it, you should go to C++, take a look at LoggerInterface Manual.

                Cheers,
                Maxime.

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

                1 Reply Last reply Reply Quote 0
                • ferdinandF
                  ferdinand
                  last edited by

                  Hello @indexofrefraction,

                  without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly.

                  Thank you for your understanding,
                  Ferdinand

                  MAXON SDK Specialist
                  developers.maxon.net

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post