mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-06 05:34:39 -06:00
Follow-up changes for the -persist PR
* Restore/check should report an error instead of a success at the end if there were any errors and -persist is specified * Don't compute the file hash before passing the file to the chunk maker; this is redundant as the chunk maker will produce the file hash * Add a LOG_WERROR function to switch between LOG_WARN and LOG_ERROR dynamically
This commit is contained in:
@@ -87,9 +87,6 @@ func SetLoggingLevel(level int) {
|
||||
loggingLevel = level
|
||||
}
|
||||
|
||||
// log function type for passing as a parameter to functions
|
||||
type LogFunc func(logID string, format string, v ...interface{})
|
||||
|
||||
func LOG_DEBUG(logID string, format string, v ...interface{}) {
|
||||
logf(DEBUG, logID, format, v...)
|
||||
}
|
||||
@@ -110,6 +107,15 @@ func LOG_ERROR(logID string, format string, v ...interface{}) {
|
||||
logf(ERROR, logID, format, v...)
|
||||
}
|
||||
|
||||
func LOG_WERROR(isWarning bool, logID string, format string, v ...interface{}) {
|
||||
if isWarning {
|
||||
logf(WARN, logID, format, v...)
|
||||
} else {
|
||||
logf(ERROR, logID, format, v...)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func LOG_FATAL(logID string, format string, v ...interface{}) {
|
||||
logf(FATAL, logID, format, v...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user