Metadata-Version: 2.1
Name: logqueue
Version: 0.0.0
Summary: Log Queue
Project-URL: Homepage, https://github.com/chorong8883/logqueue
Author-email: Chor <chorong8883@gmail.com>
License-File: LICENSE
Keywords: log,log q,log queue,logger,logger q,logger queue,logging,logging q,logging queue,queue
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# logq
Log Queue

## implement logq.get()
```python  
import logq
def log_worker():
    while True:
        log_dict = logq.get()
        if not log_dict:
            break
        print(log_dict)
    
thread = threading.Thread(target=log_worker)
thread.start()
# ...
# thread.join()
```

## logging
```python  
logq.info("start")
logq.info("finish")
```

```python 
log_dict = logq.get()
print(log_dict)
```
output:  
{'timestamp': 1700000000.100001, 'process_id': 1234, 'thread_id': 1234567890, 'log_type': 'information', 'file_name': 'test.py', 'file_lineno': 2, 'text': 'start'}  
{'timestamp': 1700000000.100002, 'process_id': 1234, 'thread_id': 1234567890, 'log_type': 'information', 'file_name': 'test.py', 'file_lineno': 2, 'text': 'start'}  

## flush logq.get()
```python  
def log_worker():
    while True:
        log_dict = logq.get()
        if not log_dict:
            break
        print(log_dict)

    while not logq.empty():
        log_dict = logq.get()
        print(log_dict)
        
    print("flush queue")
```