{"action":"opened","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/3368","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/3368/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/3368/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/3368/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/3368","id":374746061,"node_id":"MDU6SXNzdWUzNzQ3NDYwNjE=","number":3368,"title":"Is it possible to add custom log level?","user":{"login":"mitjans","id":7190600,"node_id":"MDQ6VXNlcjcxOTA2MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/7190600?v=4","gravatar_id":"","url":"https://api.github.com/users/mitjans","html_url":"https://github.com/mitjans","followers_url":"https://api.github.com/users/mitjans/followers","following_url":"https://api.github.com/users/mitjans/following{/other_user}","gists_url":"https://api.github.com/users/mitjans/gists{/gist_id}","starred_url":"https://api.github.com/users/mitjans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitjans/subscriptions","organizations_url":"https://api.github.com/users/mitjans/orgs","repos_url":"https://api.github.com/users/mitjans/repos","events_url":"https://api.github.com/users/mitjans/events{/privacy}","received_events_url":"https://api.github.com/users/mitjans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-28T11:58:21Z","updated_at":"2018-10-28T11:58:21Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nI'm trying to log certain information based on the contents of a websocket message. The default log level is \"Info\", which means that every time a websocket message is received either by the client or the server, the following message is presented in the EventLog panel:\r\n\r\n`info: 192.168.1.54:59672 <- WebSocket 1 message <- \"server address\"`\r\n\r\nA lot of websocket messages are sent between client and server, so the EventLog gets filled with this info level logs. To avoid it, I can lower the log level to \"warn\" or \"error\" and use `ctx.log.warn` or `ctx.log.error` in my script to print the logs I'm interested in. This workaround is, although functional, a bit cumbersome and impractical (my script logs will be in red and merged with real errors and warnings).\r\n\r\nIs there a way to suppress default \"info\" logging done by mitm? If not, is there a way to create a custom log level, and then filter the EventLog with the newly created level so that EventLog only displays my logs?\r\n\r\nThanks in advance!"}}
{"actor":{"display_login":"mitjans"}}