-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo-trace.html
200 lines (186 loc) · 9.39 KB
/
go-trace.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dizitart | GoTrace</title>
<meta name="description" content="Go Trace Utility">
<meta name="keywords" content="Golang, Trace, Logging, Open Source, Github">
<meta name="author" content="Anindya Chatterjee">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
<!-- Bootstrap-->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Google fonts - Open Sans-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,700,400italic">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- owl carousel-->
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/owl.theme.css">
<!--Highlighter-->
<link rel="stylesheet" href="css/prism.css" data-noprefix>
<!-- theme stylesheet-->
<link rel="stylesheet" href="css/style.sea.css" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="css/custom.css">
<!-- Favicon-->
<link rel="shortcut icon" href="favicon.png">
<!-- Tweaks for older IEs--><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
</head>
<body>
<div id="all">
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
<!-- *** SIDEBAR ***-->
<div id="sidebar" class="col-xs-6 col-sm-4 col-md-3 sidebar-offcanvas">
<div class="sidebar-content">
<a href="index.html">
<img src="img/logo.svg" class="logo-md">
</a>
<table class="table doc-details">
<thead>
<tr>
<th>GIT SHA</th>
<th>DOCUMENTATION</th>
</tr>
</thead>
<tbody>
<tr>
<td>1dc5130 <span class="label label-success label-release xx-small-font">Current</span></td>
<td><a href="https://godoc.org/github.com/dizitart/trace">API</a></td>
</tr>
</tbody>
</table>
<p class="sidebar-p">
<i class="fa fa-heart" aria-hidden="true" style="color: red"></i>
from Kolkata, India. </p>
<p class="social">
<a href="https://github.com/dizitart/trace" data-animate-hover="pulse" class="external github"><i
class="fa fa-github"></i></a>
<a href="https://twitter.com/dizitart" data-animate-hover="pulse" class="external twitter"><i
class="fa fa-twitter"></i></a>
<a href="mailto:[email protected]?subject=GoTrace Query" data-animate-hover="pulse"
class="email"><i class="fa fa-envelope"></i></a></p>
<div class="copyright">
<p class="credit">© 2018 Dizitart | Template by <a
href="https://bootstrapious.com/tutorials" class="external">Bootstrapious</a></p>
<!-- Please do not remove the backlink to us, unless you support the development at https://bootstrapious.com/donate. It is part of the license conditions. Thanks for understanding :) -->
</div>
</div>
</div>
<!-- *** SIDEBAR END *** -->
<!-- *** DETAIL ***-->
<div class="col-xs-12 col-sm-8 col-md-9 content-column white-background">
<div class="small-navbar visible-xs">
<h1 class="small-navbar-heading"> <a href="index.html">Dizitart </a></h1>
</div>
<div class="github-badge hidden-xs">
<a href="https://github.com/dizitart/trace">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png">
</a>
</div>
<div class="row">
<div class="col-lg-10">
<div class="content-column-content">
<h1>
Go Trace Utility
</h1>
<p class="lead">
A small utility to enable tracing in go. It prints information about current source
file, line number and input variable after formatting it according to a format specifier.
</p>
<div>
<pre class="command-line" data-user="user" data-host="localhost"><code class="language-bash">go get github.com/dizitart/trace</code>
</pre>
<p></p>
<h4>Usage</h4>
<pre>
<code class="language-go">
package main
import (
"fmt"
"github.com/dizitart/trace"
"time"
)
func main() {
fmt.Println("Hello World")
// Set up tracing
trace.ENABLE_TRACE = true
trace.SetOut(trace.OUT_ALL)
trace.TRACE_FILE_PATH = "/temp/trace.log"
trace.SetMessageFormat(trace.PRINT_FILE | trace.PRINT_LINE | trace.PRINT_PROC)
someString := "Hello World"
// assert
trace.Assert(someString == "hello world")
// formatted assertion
trace.Assertf(someString == "hello world", "Assertion Failed! at %v", time.Now())
// write
trace.Write(someString)
// formatted write
trace.Writef("Tracing at %v for value %s", time.Now(), someString)
}
</code>
</pre>
</div>
</div>
</div>
</div>
<div class="small-navbar visible-xs">
<table class="table doc-details">
<thead>
<tr>
<th>GIT SHA</th>
<th>DOCUMENTATION</th>
</tr>
</thead>
<tbody>
<tr>
<td>1dc5130 <span class="label label-success label-release xx-small-font">Current</span></td>
<td><a href="https://godoc.org/github.com/dizitart/trace">API</a></td>
</tr>
</tbody>
</table>
<p class="sidebar-p">
<i class="fa fa-heart" aria-hidden="true" style="color: red"></i>
from Kolkata, India. </p>
<p class="social">
<a href="https://github.com/dizitart/nitrite-database" data-animate-hover="pulse" class="external github"><i
class="fa fa-github"></i></a>
<a href="https://twitter.com/dizitart" data-animate-hover="pulse" class="external twitter"><i
class="fa fa-twitter"></i></a>
<a href="mailto:[email protected]?subject=Nitrite Query" data-animate-hover="pulse"
class="email"><i class="fa fa-envelope"></i></a></p>
<div class="copyright">
<p class="credit">© 2018 Dizitart | Template by <a
href="https://bootstrapious.com/tutorials" class="external">Bootstrapious</a></p>
<!-- Please do not remove the backlink to us, unless you support the development at https://bootstrapious.com/donate. It is part of the license conditions. Thanks for understanding :) -->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Javascript files-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="js/ekko-lightbox.js"></script>
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/front.js"></script>
<script src="js/prism.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-98024264-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>