itamarst / eliot

Eliot: the logging system that tells you *why* it happened
https://eliot.readthedocs.io
Apache License 2.0
1.09k stars 65 forks source link

ArgumentError when use eliot-tree #454

Closed RyuAsuka closed 4 years ago

RyuAsuka commented 4 years ago

Test code:

from eliot import log_call, to_file

to_file(open('log.log', 'w'))

@log_call(action_type='CALC', include_args=['x'], include_result=True)
def calculate(x, y):
    return x * y

x = 2
y = 10
result = calculate(x, y)
print(result)

Then use eliot-tree log.log it returns an Argument Error.

Exceptions (1) occurred during processing:
Traceback (most recent call last):
  File "C:\Users\paule\Anaconda3\lib\site-packages\toolz\functoolz.py", line 781, in __call__
    return self.func(*args, **kwargs)
  File "C:\Users\paule\Anaconda3\lib\site-packages\eliottree\_render.py", line 117, in format_node
    format.escape_control_characters(node.root().task_uuid)))
  File "C:\Users\paule\Anaconda3\lib\site-packages\eliottree\_color.py", line 43, in __color
    return colored(text, fg, bg, attrs=attrs)
  File "C:\Users\paule\Anaconda3\lib\site-packages\eliottree\_color.py", line 30, in colored
    _colored.fg(fg) if fg is not None else u'',
  File "C:\Users\paule\Anaconda3\lib\site-packages\colored\colored.py", line 402, in fg
    return colored(color).foreground()
  File "C:\Users\paule\Anaconda3\lib\site-packages\colored\colored.py", line 22, in __init__
    self.enable_windows_terminal_mode()
  File "C:\Users\paule\Anaconda3\lib\site-packages\colored\colored.py", line 373, in enable_windows_terminal_mode
    hStdout = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
itamarst commented 4 years ago

Hi,

Sorry it didn't work. eliot-tree is actually a different project, could you file it there? https://github.com/jonathanj/eliottree

itamarst commented 4 years ago

Thanks!