File size: 531 Bytes
8ab43a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from logger import get_sage_logger

def test_logging():
    print("--- STARTING LOGGER TEST ---")
    log = get_sage_logger("test_module")
    log.debug("This is a DEBUG message.")
    log.info("This is an INFO message.")
    try:
        x = 1 / 0
    except Exception as e:
        log.error(f"This is an ERROR message with exception: {e}")
    print("--- LOGGER TEST COMPLETE ---")

if __name__ == "__main__":
    test_logging()