derek-thomas HF staff commited on
Commit
e6a15ab
1 Parent(s): 96fa9f8

Updated the console to be prettier

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -16,7 +16,7 @@ def log_file_to_html_string():
16
  log_file = "mylog.log"
17
  num_lines_visualize = 50
18
 
19
- console = Console(record=True, width=150)
20
  with open(log_file, "rt") as f:
21
  # Seek to the end of the file minus 300 lines
22
  # Read the last 300 lines of the file
@@ -30,6 +30,12 @@ def log_file_to_html_string():
30
  console.print(syntax)
31
  html_content = console.export_html(inline_styles=True)
32
 
 
 
 
 
 
 
33
  return html_content
34
 
35
 
 
16
  log_file = "mylog.log"
17
  num_lines_visualize = 50
18
 
19
+ console = Console(record=True, width=150, style="#272822")
20
  with open(log_file, "rt") as f:
21
  # Seek to the end of the file minus 300 lines
22
  # Read the last 300 lines of the file
 
30
  console.print(syntax)
31
  html_content = console.export_html(inline_styles=True)
32
 
33
+ style_replace = """
34
+ pre, code {
35
+ background-color: #272822;
36
+ }
37
+ </style>"""
38
+ html_content = html_content.replace('</style>', style_replace)
39
  return html_content
40
 
41