Colors and Special Text Effects in Go Logs: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
* https://www.baeldung.com/java-log-console-in-color
* https://www.baeldung.com/java-log-console-in-color
* https://github.com/bit101/go-ansi
* https://github.com/bit101/go-ansi
* https://codehs.com/tutorial/andy/ansi-colors


=Internal=
=Internal=
Line 12: Line 13:
* Red: <code>\u001B[31m</code>
* Red: <code>\u001B[31m</code>
* Blue: <code>\u001B[34m</code>
* Blue: <code>\u001B[34m</code>
* Green: <code>\u001B[32m</code>
* Black: <code>\u001B[30m</code>
* Yellow: <code>\u001B[33m</code>
* Purple: <code>\u001B[35m</code>
* Cyan: <code>\u001B[36m</code>
* White: <code>\u001B[37m</code>
* Bold: <code>\u001B[1m</code>
* Bold: <code>\u001B[1m</code>


End text effect: <code>\u001B[0m</code>.
End text effect: <code>\u001B[0m</code>.
To combine effects: <code>"\u001B[31m\u001B[1m ..... \u001B[0m"</code>.

Latest revision as of 22:09, 5 January 2024

External

Internal

Overview

Text effects:

  • Red: \u001B[31m
  • Blue: \u001B[34m
  • Green: \u001B[32m
  • Black: \u001B[30m
  • Yellow: \u001B[33m
  • Purple: \u001B[35m
  • Cyan: \u001B[36m
  • White: \u001B[37m
  • Bold: \u001B[1m

End text effect: \u001B[0m.

To combine effects: "\u001B[31m\u001B[1m ..... \u001B[0m".