Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging to file not working #95

Closed
jessebot opened this issue Nov 25, 2022 · 0 comments · Fixed by #94
Closed

logging to file not working #95

jessebot opened this issue Nov 25, 2022 · 0 comments · Fixed by #94
Assignees
Labels
bug Something isn't working 🐧 Linux 🍎 macOS

Comments

@jessebot
Copy link
Owner

something happens with rich and it fails horrendously:

onboardme -s dot_files -l debug -o test.log

╭─────── Compatibility Check ─────────────────────╮
│ Operating System and Architechure supported ♥   │
╰─────────────────────────────────────────────────╯
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/rich/logging.py", line 170, in emit
    self.console.print(log_renderable)
  File "/usr/local/lib/python3.11/site-packages/rich/console.py", line 1667, in print
    with self:
  File "/usr/local/lib/python3.11/site-packages/rich/console.py", line 869, in __exit__
    self._exit_buffer()
  File "/usr/local/lib/python3.11/site-packages/rich/console.py", line 827, in _exit_buffer
    self._check_buffer()
  File "/usr/local/lib/python3.11/site-packages/rich/console.py", line 2039, in _check_buffer
    self.file.write(text)
    ^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'write'
Call stack:
  File "/usr/local/bin/onboardme", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/onboardme/__init__.py", line 119, in main
    usr_pref = process_configs(overwrite, git_url, git_branch, pkg_managers,
  File "/usr/local/lib/python3.11/site-packages/onboardme/env_config.py", line 155, in process_configs
    log.debug(f"cli_dict is:\n{cli_dict}\n", extra={"markup": True})
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 2158, in debug
    root.debug(msg, *args, **kwargs)
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1477, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 978, in handle
    self.emit(record)
  File "/usr/local/lib/python3.11/site-packages/rich/logging.py", line 172, in emit
    self.handleError(record)
Message: "cli_dict is:\n{'package': {'managers': {'Darwin': ()}, 'groups': ()}, 'log': {'file': None, 'level': ''}, 'remote_hosts': (), 'firewall': False, 'steps': {'Darwin': ('dot_files',)}, 'dot_files': {'overwrite': False, 'git_url': None, 'git_branch': None}}\n"
Arguments: ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🐧 Linux 🍎 macOS
Projects
None yet
1 participant