Skip to content

Commit 64224fc

Browse files
committed
go fmt
1 parent ed69e2d commit 64224fc

40 files changed

+1513
-1514
lines changed

behavior_adaptive_test.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -25,14 +25,14 @@
2525
package seelog
2626

2727
import (
28-
"strconv"
29-
"testing"
30-
"io/ioutil"
3128
"bufio"
3229
"bytes"
33-
"io"
3430
"errors"
3531
"fmt"
32+
"io"
33+
"io/ioutil"
34+
"strconv"
35+
"testing"
3636
)
3737

3838
func countSequencedRowsInFile(filePath string) (int64, error) {
@@ -70,7 +70,6 @@ func countSequencedRowsInFile(filePath string) (int64, error) {
7070
return gotCounter, nil
7171
}
7272

73-
7473
func Test_Adaptive(t *testing.T) {
7574
fileName := "beh_test_adaptive.log"
7675
count := 100

behavior_adaptivelogger.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -103,7 +103,7 @@ func (asnAdaptiveLogger *asyncAdaptiveLogger) processItem() (closed bool, itemCo
103103
}
104104

105105
// I = m + (C - Min(c, C)) / C * (M - m) =>
106-
// I = m + cDiff * mDiff,
106+
// I = m + cDiff * mDiff,
107107
// cDiff = (C - Min(c, C)) / C)
108108
// mDiff = (M - m)
109109
func (asnAdaptiveLogger *asyncAdaptiveLogger) calcAdaptiveInterval(msgCount int) time.Duration {

behavior_asynclooplogger.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

behavior_asynctimer_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

behavior_asynctimerlogger.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

behavior_synclogger.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -63,7 +63,7 @@ func (syncLogger *syncLogger) Close() {
6363
func (syncLogger *syncLogger) Flush() {
6464
syncLogger.m.Lock()
6565
defer syncLogger.m.Unlock()
66-
66+
6767
if !syncLogger.closed {
6868
syncLogger.config.RootDispatcher.Flush()
6969
}

behavior_synclogger_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

cfg_config.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -61,7 +61,7 @@ func LoggerFromConfigAsString(data string) (LoggerInterface, error) {
6161
return LoggerFromConfigAsBytes([]byte(data))
6262
}
6363

64-
// LoggerFromWriterWithMinLevel creates a simple logger for usage with non-Seelog systems.
64+
// LoggerFromWriterWithMinLevel creates a simple logger for usage with non-Seelog systems.
6565
// Creates logger that writes to output with minimal level = minLevel.
6666
func LoggerFromWriterWithMinLevel(output io.Writer, minLevel LogLevel) (LoggerInterface, error) {
6767
constraints, err := newMinMaxConstraints(minLevel, CriticalLvl)

cfg_errors.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

cfg_logconfig.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) 2012 - Cloud Instruments Co., Ltd.
2-
//
2+
//
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
6-
// modification, are permitted provided that the following conditions are met:
7-
//
6+
// modification, are permitted provided that the following conditions are met:
7+
//
88
// 1. Redistributions of source code must retain the above copyright notice, this
9-
// list of conditions and the following disclaimer.
9+
// list of conditions and the following disclaimer.
1010
// 2. Redistributions in binary form must reproduce the above copyright notice,
1111
// this list of conditions and the following disclaimer in the documentation
12-
// and/or other materials provided with the distribution.
13-
//
12+
// and/or other materials provided with the distribution.
13+
//
1414
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1515
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1616
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -64,7 +64,7 @@ var loggerTypeToStringRepresentations = map[loggerTypeFromString]string{
6464
adaptiveLoggerTypeFromString: adaptiveLoggerTypeFromStringStr,
6565
}
6666

67-
// getLoggerTypeFromString parses a string and returns a corresponding logger type, if successful.
67+
// getLoggerTypeFromString parses a string and returns a corresponding logger type, if successful.
6868
func getLoggerTypeFromString(logTypeString string) (level loggerTypeFromString, found bool) {
6969
for logType, logTypeStr := range loggerTypeToStringRepresentations {
7070
if logTypeStr == logTypeString {
@@ -75,7 +75,7 @@ func getLoggerTypeFromString(logTypeString string) (level loggerTypeFromString,
7575
return 0, false
7676
}
7777

78-
// logConfig stores logging configuration. Contains messages dispatcher, allowed log level rules
78+
// logConfig stores logging configuration. Contains messages dispatcher, allowed log level rules
7979
// (general constraints and exceptions), and messages formats (used by nodes of dispatcher tree)
8080
type logConfig struct {
8181
Constraints logLevelConstraints // General log level rules (>min and <max, or set of allowed levels)

0 commit comments

Comments
 (0)