omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Logging

    Pythonista
    5
    7
    3928
    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.
    • paul b
      paul b last edited by

      import logging
      logging.warning('Watch out!') # will print a message to the console
      logging.info('I told you so') # will not print anything
      

      this produces no output to my pythonista console.
      What is wrong

      Phuket2 cvp mikael 3 Replies Last reply Reply Quote 0
      • Phuket2
        Phuket2 @paul b last edited by

        @paul-b , your code works as expected on my system. I see the 'Watch out!' Msg in red in the console.
        My system is -
        ('pythonista_ver_str', '3.2')
        ('pythonista_ver_num', '320000')
        ('ios_ver_str', '11.2.2')
        ('screen_resoultion', Size(1366.00, 1024.00))
        ('screen_scale', 2.0)
        ('machine_architecture', '64bit')
        ('machine_model', 'iPad7,2')

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp @paul b last edited by cvp

          @paul-b Ok for me also with last Pythonista and IOS versions on a iPad Mini 4...

          Using script of @Phuket2 :

          ('pythonista_ver_str', '3.2')
          ('pythonista_ver_num', '320000')
          ('ios_ver_str', '11.2.5')
          ('screen_resoultion', Size(768.00, 1024.00))
          ('screen_scale', 2.0)
          ('machine_architecture', '64bit')
          ('machine_model', 'iPad5,1')

          1 Reply Last reply Reply Quote 0
          • mikael
            mikael @paul b last edited by

            @paul-b, are you getting no output at all or just output from the first line?

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              did your forget to set thenlogging levEl?

              1 Reply Last reply Reply Quote 0
              • paul b
                paul b last edited by

                Mysteriously all the scripts I tried that did not work now do work even though I have not changed anything so thanks for all the suggestions

                1 Reply Last reply Reply Quote 0
                • JonB
                  JonB last edited by

                  One thing to watch for is that logging does not get reset when globals are cleared, so your logging init code needs to check for existing handlers before adding new ones, especially if using file based handlers.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors