Date Tags stream
In [1]:
from deva import *
from rich.console import Console
console = Console()
In [2]:
range<<10>>sum>>log#>>debug
[18:22:26] 45                                                                       bus.py:31
Out[2]:
45
In [3]:
from termcolor import colored,cprint
print(colored('hello', 'red'), colored('world', 'green'))
print(colored("hello red world", 'red'))
hello world
hello red world
In [4]:
print_red_on_cyan = (lambda x: colored(x, 'red', 'on_cyan'))@P
'ddd'>>print_red_on_cyan>>print
ddd
In [6]:
from rich.console import Console
console = Console()

test_data = [
    {"jsonrpc": "2.0", "method": "sum", "params": [None, 1, 2, 4, False, True], "id": "1",},
    {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
    {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": "2"},
]

def test_log():
    enabled = False
    context = {
        "foo": "bar",
    }
    movies = ["Deadpool", "Rise of the Skywalker"]
    console.log("Hello from", console, "!")
    console.log(test_data, log_locals=True)


test_log()
[18:32:53] Hello from <console width=93                     <ipython-input-6-18734a5b6778>:16
           ColorSystem.TRUECOLOR> !                                                          
           [                                                <ipython-input-6-18734a5b6778>:17
               {                                                                             
                   'jsonrpc': '2.0',                                                         
                   'method': 'sum',                                                          
                   'params': [None, 1, 2, 4, False, True],                                   
                   'id': '1'                                                                 
               },                                                                            
               {                                                                             
                   'jsonrpc': '2.0',                                                         
                   'method': 'notify_hello',                                                 
                   'params': [7]                                                             
               },                                                                            
               {                                                                             
                   'jsonrpc': '2.0',                                                         
                   'method': 'subtract',                                                     
                   'params': [42, 23],                                                       
                   'id': '2'                                                                 
               }                                                                             
           ]                                                                                 
           ╭─────────────────── locals ───────────────────╮                                  
            context = {'foo': 'bar'}                                                       
            enabled = False                                                                
             movies = [                                                                    
                          'Deadpool',                                                      
                          'Rise of the Skywalker'                                          
                      ]                                                                    
           ╰──────────────────────────────────────────────╯