Skip to content

Commit abf5567

Browse files
Added server logs feature, misc WIP
1 parent 88c6dde commit abf5567

61 files changed

Lines changed: 7022 additions & 3870 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
2+
/* To generate run: "serverpod generate" */
3+
4+
// ignore_for_file: implementation_imports
5+
// ignore_for_file: library_private_types_in_public_api
6+
// ignore_for_file: non_constant_identifier_names
7+
// ignore_for_file: public_member_api_docs
8+
// ignore_for_file: type_literal_in_constant_pattern
9+
// ignore_for_file: use_super_parameters
10+
11+
// ignore_for_file: no_leading_underscores_for_library_prefixes
12+
import 'package:serverpod_client/serverpod_client.dart' as _i1;
13+
14+
abstract class HubLogEntry implements _i1.SerializableModel {
15+
HubLogEntry._({
16+
required this.logLevel,
17+
required this.message,
18+
this.error,
19+
this.stackTrace,
20+
required this.time,
21+
required this.order,
22+
});
23+
24+
factory HubLogEntry({
25+
required int logLevel,
26+
required String message,
27+
String? error,
28+
String? stackTrace,
29+
required DateTime time,
30+
required int order,
31+
}) = _HubLogEntryImpl;
32+
33+
factory HubLogEntry.fromJson(Map<String, dynamic> jsonSerialization) {
34+
return HubLogEntry(
35+
logLevel: jsonSerialization['logLevel'] as int,
36+
message: jsonSerialization['message'] as String,
37+
error: jsonSerialization['error'] as String?,
38+
stackTrace: jsonSerialization['stackTrace'] as String?,
39+
time: _i1.DateTimeJsonExtension.fromJson(jsonSerialization['time']),
40+
order: jsonSerialization['order'] as int,
41+
);
42+
}
43+
44+
int logLevel;
45+
46+
String message;
47+
48+
String? error;
49+
50+
String? stackTrace;
51+
52+
DateTime time;
53+
54+
int order;
55+
56+
/// Returns a shallow copy of this [HubLogEntry]
57+
/// with some or all fields replaced by the given arguments.
58+
@_i1.useResult
59+
HubLogEntry copyWith({
60+
int? logLevel,
61+
String? message,
62+
String? error,
63+
String? stackTrace,
64+
DateTime? time,
65+
int? order,
66+
});
67+
@override
68+
Map<String, dynamic> toJson() {
69+
return {
70+
'logLevel': logLevel,
71+
'message': message,
72+
if (error != null) 'error': error,
73+
if (stackTrace != null) 'stackTrace': stackTrace,
74+
'time': time.toJson(),
75+
'order': order,
76+
};
77+
}
78+
79+
@override
80+
String toString() {
81+
return _i1.SerializationManager.encode(this);
82+
}
83+
}
84+
85+
class _Undefined {}
86+
87+
class _HubLogEntryImpl extends HubLogEntry {
88+
_HubLogEntryImpl({
89+
required int logLevel,
90+
required String message,
91+
String? error,
92+
String? stackTrace,
93+
required DateTime time,
94+
required int order,
95+
}) : super._(
96+
logLevel: logLevel,
97+
message: message,
98+
error: error,
99+
stackTrace: stackTrace,
100+
time: time,
101+
order: order,
102+
);
103+
104+
/// Returns a shallow copy of this [HubLogEntry]
105+
/// with some or all fields replaced by the given arguments.
106+
@_i1.useResult
107+
@override
108+
HubLogEntry copyWith({
109+
int? logLevel,
110+
String? message,
111+
Object? error = _Undefined,
112+
Object? stackTrace = _Undefined,
113+
DateTime? time,
114+
int? order,
115+
}) {
116+
return HubLogEntry(
117+
logLevel: logLevel ?? this.logLevel,
118+
message: message ?? this.message,
119+
error: error is String? ? error : this.error,
120+
stackTrace: stackTrace is String? ? stackTrace : this.stackTrace,
121+
time: time ?? this.time,
122+
order: order ?? this.order,
123+
);
124+
}
125+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
2+
/* To generate run: "serverpod generate" */
3+
4+
// ignore_for_file: implementation_imports
5+
// ignore_for_file: library_private_types_in_public_api
6+
// ignore_for_file: non_constant_identifier_names
7+
// ignore_for_file: public_member_api_docs
8+
// ignore_for_file: type_literal_in_constant_pattern
9+
// ignore_for_file: use_super_parameters
10+
11+
// ignore_for_file: no_leading_underscores_for_library_prefixes
12+
import 'package:serverpod_client/serverpod_client.dart' as _i1;
13+
14+
abstract class HubQueryLogEntry implements _i1.SerializableModel {
15+
HubQueryLogEntry._({
16+
required this.query,
17+
required this.duration,
18+
this.numRows,
19+
this.error,
20+
required this.slow,
21+
required this.order,
22+
});
23+
24+
factory HubQueryLogEntry({
25+
required String query,
26+
required double duration,
27+
int? numRows,
28+
String? error,
29+
required bool slow,
30+
required int order,
31+
}) = _HubQueryLogEntryImpl;
32+
33+
factory HubQueryLogEntry.fromJson(Map<String, dynamic> jsonSerialization) {
34+
return HubQueryLogEntry(
35+
query: jsonSerialization['query'] as String,
36+
duration: (jsonSerialization['duration'] as num).toDouble(),
37+
numRows: jsonSerialization['numRows'] as int?,
38+
error: jsonSerialization['error'] as String?,
39+
slow: jsonSerialization['slow'] as bool,
40+
order: jsonSerialization['order'] as int,
41+
);
42+
}
43+
44+
String query;
45+
46+
double duration;
47+
48+
int? numRows;
49+
50+
String? error;
51+
52+
bool slow;
53+
54+
int order;
55+
56+
/// Returns a shallow copy of this [HubQueryLogEntry]
57+
/// with some or all fields replaced by the given arguments.
58+
@_i1.useResult
59+
HubQueryLogEntry copyWith({
60+
String? query,
61+
double? duration,
62+
int? numRows,
63+
String? error,
64+
bool? slow,
65+
int? order,
66+
});
67+
@override
68+
Map<String, dynamic> toJson() {
69+
return {
70+
'query': query,
71+
'duration': duration,
72+
if (numRows != null) 'numRows': numRows,
73+
if (error != null) 'error': error,
74+
'slow': slow,
75+
'order': order,
76+
};
77+
}
78+
79+
@override
80+
String toString() {
81+
return _i1.SerializationManager.encode(this);
82+
}
83+
}
84+
85+
class _Undefined {}
86+
87+
class _HubQueryLogEntryImpl extends HubQueryLogEntry {
88+
_HubQueryLogEntryImpl({
89+
required String query,
90+
required double duration,
91+
int? numRows,
92+
String? error,
93+
required bool slow,
94+
required int order,
95+
}) : super._(
96+
query: query,
97+
duration: duration,
98+
numRows: numRows,
99+
error: error,
100+
slow: slow,
101+
order: order,
102+
);
103+
104+
/// Returns a shallow copy of this [HubQueryLogEntry]
105+
/// with some or all fields replaced by the given arguments.
106+
@_i1.useResult
107+
@override
108+
HubQueryLogEntry copyWith({
109+
String? query,
110+
double? duration,
111+
Object? numRows = _Undefined,
112+
Object? error = _Undefined,
113+
bool? slow,
114+
int? order,
115+
}) {
116+
return HubQueryLogEntry(
117+
query: query ?? this.query,
118+
duration: duration ?? this.duration,
119+
numRows: numRows is int? ? numRows : this.numRows,
120+
error: error is String? ? error : this.error,
121+
slow: slow ?? this.slow,
122+
order: order ?? this.order,
123+
);
124+
}
125+
}

0 commit comments

Comments
 (0)