mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	fix disable router log option
This commit is contained in:
		@@ -98,7 +98,9 @@ func checkVersion() {
 | 
				
			|||||||
// newMacaron initializes Macaron instance.
 | 
					// newMacaron initializes Macaron instance.
 | 
				
			||||||
func newMacaron() *macaron.Macaron {
 | 
					func newMacaron() *macaron.Macaron {
 | 
				
			||||||
	m := macaron.New()
 | 
						m := macaron.New()
 | 
				
			||||||
 | 
						if !setting.DisableRouterLog {
 | 
				
			||||||
		m.Use(macaron.Logger())
 | 
							m.Use(macaron.Logger())
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	m.Use(macaron.Recovery())
 | 
						m.Use(macaron.Recovery())
 | 
				
			||||||
	if setting.EnableGzip {
 | 
						if setting.EnableGzip {
 | 
				
			||||||
		m.Use(macaron.Gziper())
 | 
							m.Use(macaron.Gziper())
 | 
				
			||||||
@@ -109,14 +111,14 @@ func newMacaron() *macaron.Macaron {
 | 
				
			|||||||
	m.Use(macaron.Static(
 | 
						m.Use(macaron.Static(
 | 
				
			||||||
		path.Join(setting.StaticRootPath, "public"),
 | 
							path.Join(setting.StaticRootPath, "public"),
 | 
				
			||||||
		macaron.StaticOptions{
 | 
							macaron.StaticOptions{
 | 
				
			||||||
			SkipLogging: !setting.DisableRouterLog,
 | 
								SkipLogging: setting.DisableRouterLog,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	))
 | 
						))
 | 
				
			||||||
	m.Use(macaron.Static(
 | 
						m.Use(macaron.Static(
 | 
				
			||||||
		setting.AvatarUploadPath,
 | 
							setting.AvatarUploadPath,
 | 
				
			||||||
		macaron.StaticOptions{
 | 
							macaron.StaticOptions{
 | 
				
			||||||
			Prefix:      "avatars",
 | 
								Prefix:      "avatars",
 | 
				
			||||||
			SkipLogging: !setting.DisableRouterLog,
 | 
								SkipLogging: setting.DisableRouterLog,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	))
 | 
						))
 | 
				
			||||||
	m.Use(macaron.Renderer(macaron.RenderOptions{
 | 
						m.Use(macaron.Renderer(macaron.RenderOptions{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user