SpookyBiscuit40
SpookyBiscuit40
WWindmill
Created by SpookyBiscuit40 on 12/10/2024 in #help
Python Import Error
Can anyone help with this error? It's a simple script for testing. This script works locally on my pc as well. Source code:
import logging
from loguru import logger
from logtail import LogtailHandler

logtail = LogtailHandler(source_token='')

def main():
logger.remove()
logger.add("/var/log/loguru.log")

logger.add(
logtail,
format="{message}",
level="INFO",
backtrace=False,
diagnose=False,
)

logger.trace("A trace message.")
logger.debug("A debug message.")
logger.info("An info message.")
logger.success("A success message.")
logger.warning("A warning message.")
logger.error("An error message.")
logger.critical("A critical message.")

if __name__ == "__main__":
main()
import logging
from loguru import logger
from logtail import LogtailHandler

logtail = LogtailHandler(source_token='')

def main():
logger.remove()
logger.add("/var/log/loguru.log")

logger.add(
logtail,
format="{message}",
level="INFO",
backtrace=False,
diagnose=False,
)

logger.trace("A trace message.")
logger.debug("A debug message.")
logger.info("An info message.")
logger.success("A success message.")
logger.warning("A warning message.")
logger.error("An error message.")
logger.critical("A critical message.")

if __name__ == "__main__":
main()
Error:
ExecutionErr: ExitCode: 1, last log lines:
call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/tmp/windmill/wk-default-ce4729853c5d-I4gB0/0193ae94-236d-b0ae-29a2-6da341a6fd22/wrapper.py", line 10, in <module>
from u.ashafer import log_testing as inner_script
File "/tmp/windmill/wk-default-ce4729853c5d-I4gB0/0193ae94-236d-b0ae-29a2-6da341a6fd22/u/ashafer/log_testing.py", line 3, in <module>
from logtail import LogtailHandler
ImportError: cannot import name 'LogtailHandler' from 'logtail' (/tmp/windmill/cache/python_311/logtail==1.0.1/logtail/__init__.py)
ExecutionErr: ExitCode: 1, last log lines:
call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/tmp/windmill/wk-default-ce4729853c5d-I4gB0/0193ae94-236d-b0ae-29a2-6da341a6fd22/wrapper.py", line 10, in <module>
from u.ashafer import log_testing as inner_script
File "/tmp/windmill/wk-default-ce4729853c5d-I4gB0/0193ae94-236d-b0ae-29a2-6da341a6fd22/u/ashafer/log_testing.py", line 3, in <module>
from logtail import LogtailHandler
ImportError: cannot import name 'LogtailHandler' from 'logtail' (/tmp/windmill/cache/python_311/logtail==1.0.1/logtail/__init__.py)
3 replies
WWindmill
Created by SpookyBiscuit40 on 9/20/2024 in #help
logging on self-hosted
Hey everyone, currently right now I have a script with a large output and it looks like the logs are getting saved to the disk at logs/x/x. I can't find this folder anywhere on the host system and not even in the shell of a worker. Where can I find this?
2 replies