A desktop backup program focusing on ease-of-use and simplicity, as well as quality, low resource usage, and performance.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EZ-Bkup/shared.nim

26 lines
663 B

1 year ago
#[Copyright 2023 ITwrx.
This file is part of EZ-Bkup.
EZ-Bkup is released under the General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
import logging, times, os
1 year ago
let appPath* = getHomeDir() & ".ez-bkup"
let databasePath* = appPath & "/ez-bkup.sqlite"
1 year ago
if not dirExists(appPath):
createDir(appPath)
var logger = newFileLogger(appPath & "/errors.log")
let dt = now()
let nowDT* = dt.format("M-d-YYYY h:mm:ss tt")
1 year ago
proc writeErrorToLog*(logMsg: string) =
logger.log(lvlError, logMsg)
proc writeInfoToLog*(logMsg: string) =
logger.log(lvlInfo, logMsg)
proc hasCommas*(filename: string):bool =
',' in filename