From 5422f23ed8174661b6e658250e4007b7fdf0d603 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 7 Apr 2019 01:25:14 +0100 Subject: Quieter Integration Tests (#6513) * Rename BaseLogger to WriterLogger to help the creation of other providers * Don't export ColorBytes and ResetBytes from ColoredValues * Make integration tests only print logs if they fail * check can color before coloring * I always forget about MSSQL * Oh and use LEVEL in sqlite.ini * Make the test logger log at info - as it means you see the router * Remove empty expected changes * Make the migrations quieter too * Don't display SQL on error - it can be looked at in the file logs if necessary * Fix skip when using onGiteaRun --- modules/setting/log.go | 9 +++++++++ modules/setting/setting.go | 6 +----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'modules/setting') diff --git a/modules/setting/log.go b/modules/setting/log.go index c6b5b1a617..aafb4b3725 100644 --- a/modules/setting/log.go +++ b/modules/setting/log.go @@ -273,6 +273,15 @@ func newLogService() { golog.SetOutput(log.NewLoggerAsWriter("INFO", log.GetLogger(log.DEFAULT))) } +// NewLogServices creates all the log services +func NewLogServices(disableConsole bool) { + newLogService() + newMacaronLogService() + newRouterLogService() + newAccessLogService() + NewXORMLogService(disableConsole) +} + // NewXORMLogService initializes xorm logger service func NewXORMLogService(disableConsole bool) { EnableXORMLog = Cfg.Section("log").Key("ENABLE_XORM_LOG").MustBool(true) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index b6c5740024..ab290fc4fc 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -982,11 +982,7 @@ func loadOrGenerateInternalToken(sec *ini.Section) string { // NewServices initializes the services func NewServices() { newService() - newLogService() - newMacaronLogService() - newAccessLogService() - newRouterLogService() - NewXORMLogService(false) + NewLogServices(false) newCacheService() newSessionService() newMailService() -- cgit v1.2.3