Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8232391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:49:24+00:00 2026-06-07T17:49:24+00:00

The following script: #!/usr/bin/env python from fabric.api import env, run import logging logging.getLogger().setLevel(logging.INFO) env.host_string

  • 0

The following script:

#!/usr/bin/env python
from   fabric.api import env, run
import logging

logging.getLogger().setLevel(logging.INFO)

env.host_string = "%s@%s:%s" % ('myuser', 'myhost', '22')
res = run('date', pty = False)

Produces the following output:

[myuser@myhost:22] run: date
No handlers could be found for logger "ssh.transport"
[myuser@myhost:22] out: Thu Mar 29 16:15:15 CEST 2012

I would like to get rid of this annoying error message: No handlers could be found for logger "ssh.transport"
The problem happens when setting the log level (setLevel).

How can I solve this? I need to set the log level, so skipping that won’t help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:49:26+00:00Added an answer on June 7, 2026 at 5:49 pm

    My hack is ugly but works:

    # This is here to avoid the mysterious messages: 'No handlers could be found for logger "ssh.transport"'
    
    class MyNullHandler(logging.Handler):
        def emit(self, record):
            pass
    
    bugfix_loggers = { }
    def bugfix(name):
        global bugfix_loggers
        if not name in bugfix_loggers:
            # print "Setting dummy logger for '%s'" % (name)
            logging.getLogger(name).addHandler(MyNullHandler())
            bugfix_loggers[name] = True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following python script works fine: #!/usr/bin/env python import httplib, urllib params = urllib.urlencode({'url':'xxx/xxx/0AAAUw7n6qPQ922.jpg',
I wrote the following script, which generates a SyntaxError : #!/usr/bin/python print Enter the
The following script works fine: #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use
I have a script a.py : #!/usr/bin/env python def foo(arg1, arg2): return int(arg1) +
I have written a script in haskell named testscript with the following code: #!/usr/bin/env
I have the following script: #!/usr/bin/env ruby require 'rubygems' require 'net/ssh' Net::SSH.start('host1', 'root', :password
The following script #!/usr/bin/Rscript --vanilla x <- c(4.5,6.4,7.2,6.7,8.8,7.8,9.6,7.0,5.9,6.8,5.7,5.2) fertilizer<- factor(c('A','A','A','A','B','B','B','B','C','C','C','C')) crop <- factor(c('I','II','III','IV','I','II','III','IV','I','II','III','IV')) av
I have to maintain the following Perl script: #!/usr/bin/perl -w die Usage: $0 <file1>
I have the following script #!/usr/bin/Rscript print (shebang works) in a file called shebang.r.
I write the following script #!/usr/bin/perl system( awk -F= '{s[$1]++}{print $1s[$1],$2}' OFS== /var/tmp/file );

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.