log.io
log.io copied to clipboard
ASCII color support
Currently I'm piping a program's output into a text file and then let log.io
track it. However, it gives [0M
-type of characters in the stream and not format them (like it would have if I were using less -r
). Is the support for this functionality?
This is not currently supported... I'll add this as a feature request. I'm not too familiar with all ASCII color escape codes, would implementing support for the following table be sufficient? https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
I'd say that's sufficient. If we go with stuff like screen clearing, that'll open a huge can of worm.
I'm also interested in coloring the output
Use : https://github.com/nteract/ansi-to-react in ScreenMessage
const ScreenMessage: React.FC<ScreenMessageProps> = ({ message, messageFilter }) => { return (
<Ansi> {part.text} </Ansi> )} {!messageFilter && <Ansi>{message}</Ansi>}
see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx
@sguilly you should make this a pull request. Any instructions on how to use your changes? I got the main code working, but don't know how to add your edits. My experience is limited with node/npm.
Use : https://github.com/nteract/ansi-to-react in ScreenMessage
const ScreenMessage: React.FC = ({ message, messageFilter }) => { return (
{messageFilter && _parseMessageParts(message, messageFilter).map((part, i) => <span key={i} className={part.highlight ? 'highlight' : ''}>
{part.text}
)} {!messageFilter && {message}}
) } see : https://github.com/s3pweb/log.io/blob/master/ui/src/components/screens/index.tsx
It looks good! Please pull a request.