rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.88k stars 400 forks source link

TypeError running mloginfo --distinct --verbose #781

Closed niccottrell closed 4 years ago

niccottrell commented 4 years ago

Actual/current behavior

mloginfo --distinct server_mongosD.log is fine but reports:

distinct couldn't match 2217 lines
to show non-matched lines, run with --verbose.

mloginfo --distinct server_mongosD.log --verbose gives:

Traceback (most recent call last):
  File "/Users/nic/anaconda3/bin/mloginfo", line 10, in <module>
    sys.exit(main())
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/mtools/mloginfo/mloginfo.py", line 108, in main
    tool.run()
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/mtools/mloginfo/mloginfo.py", line 103, in run
    section.run()
  File "/Users/nic/anaconda3/lib/python3.7/site-packages/mtools/mloginfo/sections/distinct_section.py", line 92, in run
    print("couldn't match:" + logevent)
TypeError: can only concatenate str (not "LogEvent") to str

Environment

Software Version
mtools 1.6.1
MongoDB server mongos 3.6.12
Operating system Mac / Python 3.7.3 (default, Mar 27 2019, 16:54:48) [Clang
stennie commented 4 years ago

A fix has already been committed for mtools 1.6.2 (see #769)

Regards, Stennie