Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.13 KB

logging.md

File metadata and controls

43 lines (30 loc) · 1.13 KB

Logging

Back

Table of Contents

Introduction

If the environment variable LOG_IS_DISPLAY is set to true, arges of echoLog and echoErrorMsg will be displayed in the terminal. If false is set, it will not be displayed.

The environment variable LOG_DIR is the path of the directory to output log files.

If the environment variable LOG_IS_FILE is set to true, arges of echoLog will be output to the log file. If false is set, it will not be output.

If the environment variable LOG_IS_ERROR_FILE is set to true, arges of echoErrorMsg will be output to the error log file. If false is set, it will not be output.

API

proc echoLog*(output: any, args:varargs[string]) =

proc echoErrorMsg*(msg:string) =

Sample

import basolato/logging

proc index*(request:Request, params:Params):Future[Response] {.async.} =
  try:
    echoLog("index")
  except:
    echoErrorMsg( getCurrentExceptionMsg() )