joakim666 / colortail

Like the tail command line utility but with colors
GNU General Public License v2.0
125 stars 23 forks source link

behaviour with json unicode strings #13

Open derbeneviv opened 9 years ago

derbeneviv commented 9 years ago

Hello! i tried this util and it's great for coloring tail output, the exact one i was looking for!

The only issue i found is that it can't handle plain-text lines with unicode-marced substrings.
Like this one:
Updating cache with info: [VIF({'profile': None, 'ovs_interfaceid': None, 'network': Network({'bridge': u'xenbr1', 'subnets': [Subnet({'ips': [FixedIP({'meta': {}, 'version': 4, 'type': u'fixed', 'floating_ips': [], 'address': u'10.1.9.10'})], 'version': 4, 'meta': {u'dhcp_server': u'10.1.9.11'}, 'dns': [], 'routes': [], 'cidr': u'10.1.9.0/24', 'gateway': IP({'meta': {}, 'version': 4, 'type': u'gateway', 'address': u'10.1.9.1'})})
colortail thinks that strings like u'blabla' are unicode-encoded and tries to show unicode characters instead of plain text.
so i'm getting smth like this(sorry, i can't even paste it here properly):
u'0d260▒`28X▒f-X▒6c76-499182```

instead of this:
u'971c4e48-1596-4b61-bfb3-d38ed1cec9fb'

is there a way to disable this behavior?

joakim666 commented 9 years ago

Um. Unicode strings in C/C++ is not my best field but I'll have a look at this. Obviously the current behavior seems quite undesirable.