1 2 3 4 5 6 7 8 9 10 11 12
13 14 15
16
17 /*!
18 * ======== LoggerSys ========
19 * A logger which routes events to the `System_printf` function.
20 *
21 * This logger processes log events as they are generated and routes
22 * them through the `{@link System#printf System_printf()}` function.
23 * The final disposition of the log event is dependent on which system
24 * provider has been assigned to the
25 * `{@link System#SupportProxy System.SupportProxy}` configuration parameter.
26 *
27 * Note that the log events are processed within the runtime context
28 * of the `{@link Log Log_write()}` or `{@link Log Log_print()}` function
29 * that generated the event. It is important to account for the processing
30 * overhead and stack usage imposed on the runtime context. The cost of
31 * this processing is defined by the implementation of the system provider.
32 *
33 * @a(Examples)
34 * Configuration example: The following XDC configuration statements
35 * create a logger instance, assign it as the default logger for all
36 * modules, and enable `USER1` logging in all modules of the package
37 * `my.pkg`. See the `{@link Diags#setMaskMeta Diags.setMaskMeta()}` function
38 * for details on specifying the module names.
39 *
40 * @p(code)
41 * var Defaults = xdc.useModule('xdc.runtime.Defaults');
42 * var Diags = xdc.useModule('xdc.runtime.Diags');
43 * var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
44 *
45 * var LoggerSysParams = new LoggerSys.Params();
46 * Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
47 * Diags.setMaskMeta("my.pkg.%", Diags.USER1, Diags.RUNTIME_ON);
48 * @p
49 */
50
51 module LoggerSys inherits ILogger {
52
53 /*!
54 * ======== ITimestampProxy ========
55 * User supplied time-stamp proxy
56 *
57 * This proxy allows `LoggerSys` to use a timestamp server different
58 * from the server used by `{@link xdc.runtime.Timestamp}`. However, if
59 * not supplied by a user, this proxy defaults to whichever timestamp
60 * server is used by `Timestamp`.
61 */
62 proxy TimestampProxy inherits ITimestampClient;
63
64 instance:
65
66 /*!
67 * ======== create ========
68 * Create a `LoggerSys` logger
69 *
70 * The logger instance will route all log events it receives to
71 * the {@link System#printf} function.
72 */
73 create();
74
75 internal:
76
77 struct Instance_State {
78 Bool enabled;
79 };
80 }
81 82 83
84