-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
2,655 additions
and
2,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# convert to lf on checkout. | ||
*.go text eol=lf | ||
*.mod text eol=lf | ||
*.sum text eol=lf | ||
*.md text eol=lf | ||
*.svg text eol=lf | ||
*.conf text eol=lf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.png binary | ||
*.jpg binary | ||
*.jpeg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,36 +12,42 @@ | |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// Author: fish | ||
// Author: FishGoddess | ||
// Email: [email protected] | ||
// Created at 2020/02/29 21:59:13 | ||
package main | ||
|
||
import ( | ||
"math/rand" | ||
"strconv" | ||
"time" | ||
"math/rand" | ||
"strconv" | ||
"time" | ||
|
||
"github.com/FishGoddess/logit" | ||
"github.com/FishGoddess/logit" | ||
) | ||
|
||
func main() { | ||
|
||
// Log messages with four levels. | ||
logit.Debug("I am a debug message!") | ||
logit.Info("I am an info message!") | ||
logit.Warn("I am a warn message!") | ||
logit.Error("I am an error message!") | ||
// Log messages with four levels. | ||
logit.Debug("I am a debug message!") | ||
logit.Info("I am an info message!") | ||
logit.Warn("I am a warn message!") | ||
logit.Error("I am an error message!") | ||
|
||
// If you want to output log with file info, try this: | ||
logit.EnableFileInfo() | ||
logit.Info("Show file info!") | ||
// Notice that logit has blocked some methods for more refreshing method list. | ||
// If you want to use some higher level methods, you should call logit.Me() to | ||
// get the fully functional logger, then call what you want to call. | ||
// For example, if you want to output log with file info, try this: | ||
logit.Me().EnableFileInfo() | ||
logit.Info("Show file info!") | ||
|
||
// If you have a long log and it is made of many variables, try this: | ||
// The msg is the return value of msgGenerator. | ||
logit.DebugFunc(func() string { | ||
// Use time as the source of random number generator. | ||
r := rand.New(rand.NewSource(time.Now().Unix())) | ||
return "debug rand int: " + strconv.Itoa(r.Intn(100)) | ||
}) | ||
// If you have a long log and it is made of many variables, try this: | ||
// The msg is the return value of msgGenerator. | ||
logit.DebugFunc(func() string { | ||
// Use time as the source of random number generator. | ||
r := rand.New(rand.NewSource(time.Now().Unix())) | ||
return "debug rand int: " + strconv.Itoa(r.Intn(100)) | ||
}) | ||
|
||
// If a config file "logit.conf" in "./", then logit will load it automatically. | ||
// This is more convenience to use config file and logger. | ||
} |
Oops, something went wrong.