Skip to content

Commit 91582a5

Browse files
committed
Disable verbose logging by default and add xcall.enable_verbose_logging() command
1 parent 7410116 commit 91582a5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ or just:
7474
>>> ulysses_client('get-version')
7575
```
7676

77+
## Logging
78+
As logger output just goes directly to the terminal, it is disabled by default. To enable more verbose logging use:
79+
```python
80+
>>> import xcall
81+
>>> xcall.enable_verbose_logging()
82+
```
83+
7784
## On thread/process safety
7885
Call to this module are __probably__ not thread/process safe. An attempt is made
7986
to ensure that `xcall` is not already running, but there is 20-30ms window in which

xcall.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@
3737

3838

3939
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',
40-
level=logging.DEBUG)
40+
level=logging.WARNING)
4141
logger = logging.getLogger(__name__)
4242

43+
def enable_verbose_logging():
44+
logger.setLevel(logging.DEBUG)
45+
4346

4447
class XCallbackError(Exception):
4548
"""Exception representing an x-error callback from xcall.
@@ -149,7 +152,7 @@ def _xcall(self, url, activate_app):
149152
if activate_app:
150153
args += ['-activateApp', 'YES']
151154

152-
logger.debug('XCALL_PATH: "%s"' % XCALL_PATH)
155+
logger.info('Making bash call: "%s"' % ' '.join(args))
153156

154157

155158
p = subprocess.Popen(

0 commit comments

Comments
 (0)