Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
1640a90a
Commit
1640a90a
authored
Apr 11, 2021
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: add a /debug command to change logging level dynamically
And changing the path too
parent
57cd999f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
doc/source/commands.rst
doc/source/commands.rst
+6
-0
poezio/config.py
poezio/config.py
+1
-1
poezio/core/command_defs.py
poezio/core/command_defs.py
+7
-0
poezio/core/commands.py
poezio/core/commands.py
+11
-3
No files found.
doc/source/commands.rst
View file @
1640a90a
...
...
@@ -34,6 +34,12 @@ These commands work in *any* tab.
available commands. If it has a valid command as an argument, this command
will show the usage and the help for the given command.
/debug
**Usage:** ``/debug [filename]
Reset logging and enable debugging to ``[filename]``. If the filename
is empty, debug logging will be disabled.
/join
**Usage:** ``/join [room_name][@server][/nick] [password]``
...
...
poezio/config.py
View file @
1640a90a
...
...
@@ -679,7 +679,7 @@ def post_logging_setup():
LOGGING_CONFIG
=
{
'version'
:
1
,
'disable_existing_loggers'
:
Tru
e
,
'disable_existing_loggers'
:
Fals
e
,
'formatters'
:
{
'simple'
:
{
'format'
:
'%(asctime)s %(levelname)s:%(module)s:%(message)s'
...
...
poezio/core/command_defs.py
View file @
1640a90a
...
...
@@ -442,4 +442,11 @@ def get_commands(commands: CommandCore, completions: CompletionCore, plugin_mana
"shortdesc"
:
"Reload the config. You can achieve the same by "
"sending SIGUSR1 to poezio."
,
},
{
"name"
:
"debug"
,
"func"
:
commands
.
debug
,
"usage"
:
"[debug_filename]"
,
"shortdesc"
:
"Enable or disable debug logging according to the "
"presence of [debug_filename]."
,
},
]
poezio/core/commands.py
View file @
1640a90a
...
...
@@ -14,9 +14,7 @@ from slixmpp.xmlstream.stanzabase import StanzaBase
from
slixmpp.xmlstream.handler
import
Callback
from
slixmpp.xmlstream.matcher
import
StanzaPath
from
poezio
import
common
from
poezio
import
tabs
from
poezio
import
multiuserchat
as
muc
from
poezio
import
common
,
config
as
config_module
,
tabs
,
multiuserchat
as
muc
from
poezio.bookmarks
import
Bookmark
from
poezio.config
import
config
,
DEFAULT_CONFIG
from
poezio.contact
import
Contact
,
Resource
...
...
@@ -1356,6 +1354,16 @@ class CommandCore:
"""
self
.
core
.
reload_config
()
@
command_args_parser
.
raw
def
debug
(
self
,
args
):
"""/debug [filename]"""
if
not
args
.
strip
():
config_module
.
setup_logging
(
''
)
self
.
core
.
information
(
'Debug logging disabled!'
,
'Info'
)
elif
args
:
config_module
.
setup_logging
(
args
)
self
.
core
.
information
(
f
'Debug logging to
{
args
}
enabled!'
,
'Info'
)
def
dumb_callback
(
*
args
,
**
kwargs
):
"mock callback"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment