Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Tracer / Tizen / Tracer.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace Tizen
20 {
21     /// <summary>
22     /// Provides functions for writing trace message to the system trace buffer.
23     /// </summary>
24     public static class Tracer
25     {
26         /// <summary>
27         /// Writes a trace event to indicate that a synchronous event has begun.
28         /// </summary>
29         /// <remarks>
30         /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method.
31         /// </remarks>
32         /// <param name="name">The name of event (optionally containing format specifiers)</param>
33         /// <seealso cref="Tizen.Tracer.End()"/>
34         public static void Begin (String name)
35         {
36             Interop.Tracer.Begin (name);
37         }
38
39         /// <summary>
40         /// Writes a trace event to indicate that the synchronous event has ended.
41         /// </summary>
42         /// <remarks>
43         /// Tizen.Tracer.End() ends the most recently called Tizen.Tracer.Begin().
44         /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method.
45         /// </remarks>
46         /// <seealso cref="Tizen.Tracer.Begin()"/>
47         public static void End ()
48         {
49             Interop.Tracer.End ();
50         }
51
52         /// <summary>
53         /// Writes a trace event to indicate that an asynchronous event has begun.
54         /// </summary>
55         /// <remarks>
56         /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method.
57         /// </remarks>
58         /// <param name="cookie">An unique identifier for distinguishing simultaneous events</param>
59         /// <param name="name">The name of event (optionally containing format specifiers)</param>
60         /// <seealso cref="Tizen.Tracer.AsyncEnd()"/>
61         public static void AsyncBegin (int cookie, String name)
62         {
63             Interop.Tracer.AsyncBegin (cookie, name);
64         }
65
66         /// <summary>
67         /// Writes a trace event to indicate that the asynchronous event has ended.
68         /// </summary>
69         /// <remarks>
70         /// Tizen.Tracer.AsyncEnd() ends matched Tizen.Tracer.AsyncBegin() which has same cookie and name.
71         /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method.
72         /// </remarks>
73         /// <param name="cookie">An unique identifier for distinguishing simultaneous events</param>
74         /// <param name="name">The name of event (optionally containing format specifiers)</param>
75         /// <seealso cref="Tizen.Tracer.AsyncBegin()"/>
76         public static void AsyncEnd (int cookie, String name)
77         {
78             Interop.Tracer.AsyncEnd (cookie, name);
79         }
80
81         /// <summary>
82         /// Writes a trace event to track change of integer value.
83         /// </summary>
84         /// <remarks>
85         /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method.
86         /// </remarks>
87         /// <param name="value">The integer variable to trace</param>
88         /// <param name="name">The name of event (optionally containing format specifiers)</param>
89         public static void TraceValue (int value, String name)
90         {
91             Interop.Tracer.TraceValue (value, name);
92         }
93     }
94 }
95