Paramiko日志配置

时间:2020-07-24 06:49:19

标签: logging paramiko

我看到将paramiko日志记录合并到python类中的建议如下:

logging.getLogger(“ paramiko”)。setLevel(logging.WARNING)

这是否意味着在我的记录器中,我必须在现有列表中添加一个名称为“ paramiko”的记录器,如下所示:

'loggers': {
        '': {
            'handlers': ['log_file', 'sentry'],
            'level': 'INFO',
            'propagate': False,
        },
        'django': {
            'handlers': ['log_file', 'sentry'],
            'level': 'INFO',
            'propagate': False,
        },
        'raven': {
            'level': 'DEBUG',
            'handlers': ['console', 'log_file'],
            'propagate': False,
        },
        'sentry.errors': {
            'level': 'DEBUG',
            'handlers': ['console', 'log_file'],
            'propagate': False,
        },
    },
}

我是python和paramiko的新手。我想知道python中是否有单元测试,以查看所引用的记录器(例如root或专门命名的记录器)?

1 个答案:

答案 0 :(得分:0)

只需添加

library(ggplot2)
library(ggalluvial)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

data(vaccinations)
levels(vaccinations$response) <- rev(levels(vaccinations$response))

vaccinations <- vaccinations %>% 
  group_by(survey) %>% 
  mutate(pct = freq / sum(freq))

ggplot(vaccinations,
       aes(x = survey, stratum = response, alluvium = subject,
           y = pct,
           fill = response %in% c("Missing", "Never"), 
           label = response)) +
  scale_x_discrete(expand = c(.1, .1)) +
  scale_y_continuous(label = scales::percent_format()) +
  scale_fill_manual(values = c(`TRUE` = "cadetblue1", `FALSE` = "grey50")) +
  geom_flow() +
  geom_stratum(alpha = .5) +
  geom_text(aes(label = paste0(..stratum.., "\n", scales::percent(..count.., accuracy = .1))), stat = "stratum", size = 3) +
  theme(legend.position = "none") +
  ggtitle("vaccination survey responses at three points in time")

或者,如果不指定,它将与您的自定义记录器具有相同的级别

相关问题