Commit Graph
18 Commits
Author SHA1 Message Date
zeripathandGitHub 704da08fdc Better logging (#6038) (#6095)
* Panic don't fatal on create new logger

Fixes #5854

Signed-off-by: Andrew Thornton <[email protected]>

* partial broken

* Update the logging infrastrcture

Signed-off-by: Andrew Thornton <[email protected]>

* Reset the skip levels for Fatal and Error

Signed-off-by: Andrew Thornton <[email protected]>

* broken ncsa

* More log.Error fixes

Signed-off-by: Andrew Thornton <[email protected]>

* Remove nal

* set log-levels to lowercase

* Make console_test test all levels

* switch to lowercased levels

* OK now working

* Fix vetting issues

* Fix lint

* Fix tests

* change default logging to match current gitea

* Improve log testing

Signed-off-by: Andrew Thornton <[email protected]>

* reset error skip levels to 0

* Update documentation and access logger configuration

* Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE

* Fix broken level caching

* Refactor the router log

* Add Router logger

* Add colorizing options

* Adjust router colors

* Only create logger if they will be used

* update app.ini.sample

* rename Attribute ColorAttribute

* Change from white to green for function

* Set fatal/error levels

* Restore initial trace logger

* Fix Trace arguments in modules/auth/auth.go

* Properly handle XORMLogger

* Improve admin/config page

* fix fmt

* Add auto-compression of old logs

* Update error log levels

* Remove the unnecessary skip argument from Error, Fatal and Critical

* Add stacktrace support

* Fix tests

* Remove x/sync from vendors?

* Add stderr option to console logger

* Use filepath.ToSlash to protect against Windows in tests

* Remove prefixed underscores from names in colors.go

* Remove not implemented database logger

This was removed from Gogs on 4 Mar 2016 but left in the configuration
since then.

* Ensure that log paths are relative to ROOT_PATH

* use path.Join

* rename jsonConfig to logConfig

* Rename "config" to "jsonConfig" to make it clearer

* Requested changes

* Requested changes: XormLogger

* Try to color the windows terminal

If successful default to colorizing the console logs

* fixup

* Colorize initially too

* update vendor

* Colorize logs on default and remove if this is not a colorizing logger

* Fix documentation

* fix test

* Use go-isatty to detect if on windows we are on msys or cygwin

* Fix spelling mistake

* Add missing vendors

* More changes

* Rationalise the ANSI writer protection

* Adjust colors on advice from @0x5c

* Make Flags a comma separated list

* Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING

* Ensure matching is done on the non-colored message - to simpify EXPRESSION
2019-04-02 08:48:31 +01:00
Lunny XiaoandGitHub 2dc805c0c6 Milestone issues and pull requests (#5293)
* add milestone issues and pulls page instead of redirecting issues page

* add milestone when creating issue from milestone page

* refactor to merge similiar codes as a new function issues

* remove milestone info on milestone issues list

* fix missing params
2018-11-29 09:46:30 +08:00
Lunny XiaoandGitHub eabbddcd98 Restrict permission check on repositories and fix some problems (#5314)
* fix units permission problems

* fix some bugs and merge LoadUnits to repoAssignment

* refactor permission struct and add some copyright heads

* remove unused codes

* fix routes units check

* improve permission check

* add unit tests for permission

* fix typo

* fix tests

* fix some routes

* fix api permission check

* improve permission check

* fix some permission check

* fix tests

* fix tests

* improve some permission check

* fix some permission check

* refactor AccessLevel

* fix bug

* fix tests

* fix tests

* fix tests

* fix AccessLevel

* rename CanAccess

* fix tests

* fix comment

* fix bug

* add missing unit for test repos

* fix bug

* rename some functions

* fix routes check
2018-11-28 19:26:14 +08:00
Lanre AdelowoandLunny Xiao 5e022a98e6 show only opened milestones on issues page milestone filter (#5051)
* show only opened milestones on issues page milestone filter

* update Godoc

* update Godoc everywhere

* update swagger

* use false instead of 0

* Add seccond ordering by ID for milestones where no deadline is set
2018-11-26 16:45:42 +08:00
Lanre AdelowoandLauris BH e6d54d511d make sure milestone listing is consistent across board (#4987) 2018-09-28 06:59:46 +03:00
Lunny XiaoandGitHub 6bdc556b7f Fix some webhooks bugs (#3981)
* fix some webhooks bugs

* update vendor

Signed-off-by: Bo-Yi Wu <[email protected]>

* fix test

* fix clearlabels

* fix pullrequest webhook bug fix #3492

* update release webhook description

* remove unused code

* fix push webhook in pull request

* small changes
2018-05-21 10:28:29 +08:00
Lunny XiaoandGitHub 24941a1046 Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* add more webhook support

* move hooks templates to standalone dir and add more webhooks ui

* fix tests

* update vendor checksum

* update vendor

Signed-off-by: Bo-Yi Wu <[email protected]>

* load attributes when created release

* update comparsion doc
2018-05-16 22:01:55 +08:00
Travis ParkerandLauris BH 73370b8cf7 consistent IsOverdue field name capitalization (#3909)
Milestone.IsOverDue vs Issue.IsOverdue, the former was also causing the
milestone list page template to fail to render if any milestones have a
due date assigned.

Signed-off-by: Travis J Parker <[email protected]>
2018-05-07 12:50:27 +03:00
Jonas FranzandLunny Xiao 8d5f58d834 Shows total tracked time in issue and milestone list (#3341)
* Show total tracked time in issue and milestone list
Show total tracked time at issue page

Signed-off-by: Jonas Franz <[email protected]>

* Optimizing TotalTimes by using SumInt

Signed-off-by: Jonas Franz <[email protected]>

* Fixing wrong total times for milestones caused by a missing JOIN
Adding unit tests for total times

Signed-off-by: Jonas Franz <[email protected]>

* Logging error instead of ignoring it

Signed-off-by: Jonas Franz <[email protected]>

* Correcting spelling mistakes

Signed-off-by: Jonas Franz <[email protected]>

* Change error message to a short version

Signed-off-by: Jonas Franz <[email protected]>

* Add error handling to TotalTimes
Add variable for totalTimes

Signed-off-by: Jonas Franz <[email protected]>

* Introduce TotalTrackedTimes as variable of issue
Load TotalTrackedTimes by loading attributes of IssueList
Load TotalTrackedTimes by loading attributes of single issue
Add Sec2Time as helper to use it in templates

Signed-off-by: Jonas Franz <[email protected]>

* Fixed test + gofmt

Signed-off-by: Jonas Franz <[email protected]>

* Load TotalTrackedTimes via MilestoneList instead of single requests

Signed-off-by: Jonas Franz <[email protected]>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <[email protected]>

* Add documentation for MilestoneList

Signed-off-by: Jonas Franz <[email protected]>

* Fix test

Signed-off-by: Jonas Franz <[email protected]>

* Change comment from SQL query to description

Signed-off-by: Jonas Franz <[email protected]>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <[email protected]>

* Fix unit test by using int64 instead of int

Signed-off-by: Jonas Franz <[email protected]>

* Check if timetracker is enabled

Signed-off-by: Jonas Franz <[email protected]>

* Fix test by enabling timetracking

Signed-off-by: Jonas Franz <[email protected]>
2018-04-29 13:58:47 +08:00
Morgan BazalgetteandLunny Xiao 320c9817bc Don't force due date to current time (#3830)
Fixes #3827
2018-04-23 13:55:03 +08:00
Ethan KoenigandLauris BH 0e384c6376 Check ignored errors for issue and milestone count (#3213) 2017-12-18 16:06:51 +02:00
Ethan KoenigandLauris BH 6abfa48c0e Remove unnecessary updates to issue indexer (#3212) 2017-12-17 13:53:02 +02:00
Lunny XiaoandLauris BH f2e20c81b6 Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
2017-12-11 06:37:04 +02:00
Ethan KoenigandLauris BH aa962deec0 Replace deprecated Id method with ID (#2655) 2017-10-05 07:43:04 +03:00
Lunny XiaoandLauris BH a8717e5e3a Use AfterLoad instead of AfterSet on Structs (#2628)
* use AfterLoad instead of AfterSet on Structs

* fix the comments on AfterLoad

* fix the comments on action AfterLoad
2017-10-01 19:52:35 +03:00
Lunny XiaoandGitHub dd55534b82 Reduce usage of allcols on update (#2596)
* reduce usage of allcols on update

* fix bug and tests
2017-09-25 12:59:27 +08:00
Lauris BHandLunny Xiao 6db387a21e Refactor session close as xorm already does everything needed internally (#2020) 2017-06-21 08:57:05 +08:00
Ethan KoenigandLunny Xiao a6751cec04 Unit tests for issue_milestone (#878) 2017-02-09 14:39:26 +08:00